1

I have tried so many ways(Pycharm and unittest does not work ) to solve the problem.
But I am still a bit clueless on what is going on here.
I can't run basic unittests. Thank you in advance.

#test_names.py
import unittest
from Practices.SomeFunction import get_formatted_name
class NameTestCase(unittest.TestCase):  
    """test get_fotmatted_name()"""

    def test_first_last_name(self):
        formatted_name = get_formatted_name('janis', 'joplin')
        self.assertEqual(formatted_name, 'Janis Joplin')

unittest.main() 

result

list

Y.oO
  • 33
  • 1
  • 6

2 Answers2

2

just need to add

if __name__ == '__main__': 

then

if __name__ == '__main__': 
    unittest.main()
Y.oO
  • 33
  • 1
  • 6
0

In Pycharm it isn't necessary to add the line unittest.main() If you remove it, it should work fine.

ChrisX
  • 1