998
998
runner = tests.TextTestRunner(stream=stream)
999
999
result = self.run_test_runner(runner, test)
1000
1000
lines = stream.getvalue().splitlines()
1003
'======================================================================',
1004
'FAIL: unittest.FunctionTestCase (failing_test)',
1005
'----------------------------------------------------------------------',
1006
'Traceback (most recent call last):',
1007
' raise AssertionError(\'foo\')',
1008
'AssertionError: foo',
1010
'----------------------------------------------------------------------',
1012
'FAILED (failures=1, known_failure_count=1)'],
1013
lines[3:8] + lines[9:13] + lines[14:])
1001
self.assertContainsRe(stream.getvalue(),
1004
'^======================================================================\n'
1005
'^FAIL: unittest.FunctionTestCase \\(failing_test\\)\n'
1006
'^----------------------------------------------------------------------\n'
1007
'Traceback \\(most recent call last\\):\n'
1008
' .*' # File .*, line .*, in failing_test' - but maybe not from .pyc
1009
' raise AssertionError\\(\'foo\'\\)\n'
1011
'^----------------------------------------------------------------------\n'
1013
'FAILED \\(failures=1, known_failure_count=1\\)'
1015
1016
def test_known_failure_ok_run(self):
1016
1017
# run a test that generates a known failure which should be printed in the final output.