Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tests succeed, still get traceback

I'm using Python's unittest library and all the tests succeed, but I still get a traceback and I can't understand how I can fix the problem.

........
----------------------------------------------------------------------
Ran 8 tests in 0.020s

OK

Traceback (most recent call last):
  File "C:\Users\Paul\Desktop\bloomfilter\test_bloomfilter.py", line 85, in <module>
    unittest.main()
  File "C:\Programming\PythonX86\Python27\lib\unittest\main.py", line 95, in __init__
    self.runTests()
  File "C:\Programming\PythonX86\Python27\lib\unittest\main.py", line 231, in runTests
    sys.exit(not self.result.wasSuccessful())
SystemExit: False
>>> 
like image 921
Paul Manta Avatar asked Feb 08 '12 22:02

Paul Manta


People also ask

How do I fix Python traceback error?

If there is no variable defined with that name you will get a NameError exception. To fix the problem, in Python 2, you can use raw_input() . This returns the string entered by the user and does not attempt to evaluate it. Note that if you were using Python 3, input() behaves the same as raw_input() does in Python 2.

What is last recent traceback call?

Traceback (most recent call last)?This program is supposed to accept a number and print out all the numbers up to and including that number. When Python encounters an exception that isn't handled in your code, it will print out a traceback.


1 Answers

To avoid the end of execution traceback:

if __name__ == '__main__':
    unittest.main(exit=False)
like image 51
Florent B. Avatar answered Oct 19 '22 22:10

Florent B.