I am having trouble debugging some unit tests with the pudb debugger .
The tests run fine with python, but I was not able to run them with pudb .
I highlighted the problem by referring to the following code sample:
class Math: def pow(self, x, y): return x ** y import unittest class MathTest(unittest.TestCase): def testPow23(self): self.assertEquals(8, Math().pow(2, 3)) def testPow24(self): self.assertEquals(16, Math().pow(2, 4)) if __name__ == '__main__': unittest.main()
Testing runs fine:
$ python amodule.py . ---------------------------------------------------------------------- Ran 2 tests in 0.001s OK
But if it works through pudb, it gives me the output:
---------------------------------------------------------------------- Ran 0 tests in 0.000s OK
I tried using pudb amodule.py , as well as python -m pudb.run amodule.py , but it doesnβt matter - no tests are performed in one way or another.
Should I do something else to debug unit tests with pudb?
python python-unittest pudb
elias
source share