I am trying to create a very simple unittest.TestCase class, just to check if I know how to do this. However, when I try to run the tests, they will not execute them. I wrote a very simple piece of code that should theoretically run 1 test, but it continues to say that it did not work. Here is what I wrote:
import unittest
class c(unittest.TestCase):
kv = ((1, 2), (3, 4))
def cc(self):
for k, v in self.kv:
res = tothis(k)
self.assertEqual(v, res)
The function was resnot written, but this is normal, because at this point I don’t care if the tests fail, I just want to see if I can run them.
After entering the code, I will need to perform such tests:
unittest.main()
He simply says that he did not test the tests, but must pass the test for self.assertEqual. Why doesn't he run the test?
source