I am giving an example which throws an error in ipython/jupyter notebook, but runs fine as an individual script.
import unittest class Samples(unittest.TestCase
We can try TestLoader to load test cases from TestCaseClass
and attach those testcases to TextTestRunner then run it.
import unittest suite = unittest.TestLoader().loadTestsFromTestCase(Samples) runner = unittest.TextTestRunner(verbosity=2) runner.run(suite)