from mark_3 import * # import everything from my module
import unittest # This sets the testing framework and a main program
class TestJoeTree(unittest.TestCase): # use a meaningful name
def testNoSolution(self):
self.assertEqual(0, beginRunningMain(r"C:\Users\xxx\exampleNoAns.txt", "hit", "bem")
if __name__ == '__main__':
unittest.main()
Hi, I am using Python 3 and I have difficulty to run this UnitTest Class. However, I keep getting the error message and I do not know how to run this unittest class in command prompt.
Here is the screenshot:
Can anyone guide me how to solve this error message? This is my 1st day using Python and I have spent hours searching for solution. Thank you.
You were missing a parenthesis in the assertEqual function, and you are not indenting the method testNoSolution (I think it is a method because of self
).
class TestJoeTree(unittest.TestCase): # use a meaningful name
def testNoSolution(self):
self.assertEqual(0, beginRunningMain(r"C:\Users\xxx\exampleNoAns.txt", "hit", "bem"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With