[issue13236] unittest needs more flush calls
Peter Eisentraut
report at bugs.python.org
Wed Oct 26 19:22:17 CEST 2011
Peter Eisentraut <peter_e at gmx.net> added the comment:
Attached is a test file. The key here is that I'm running the unittest suite inside of a long-running server process, so there is no predictable point of exit and cleanup. Therefore, the steps I show at the end of the file should be run in an interactive interpreter. Here is what I see:
>>> import unittest
>>> import testcase
>>> unittest.main(module=testcase)
.F.
======================================================================
FAIL: test_three (testcase.test)
----------------------------------------------------------------------
Traceback (most recent call last):
File "testcase.py", line 35, in test_three
self.fail("intentional failure")
AssertionError: intentional failure
----------------------------------------------------------------------
Ran 3 tests in 0.002s
FAILED (failures=1)
That's good.
But:
>>> import unittest
>>> import testcase
>>> unittest.main(module=testcase, testRunner=testcase.FunnyTestRunner, exit=False)
.
F
.
<unittest.main.TestProgram object at 0xf718fd4c>
You see, the test report at the end is missing.
I'm happy to consider other ways of addressing this, if anyone has an idea.
----------
Added file: http://bugs.python.org/file23527/testcase.py
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13236>
_______________________________________
More information about the Python-bugs-list
mailing list