@@ -233,7 +233,7 @@ def tearDownClass(self):
233
233
def test_method_and_teardown_failing_reporting (testdir ):
234
234
testdir .makepyfile (
235
235
"""
236
- import unittest, pytest
236
+ import unittest
237
237
class TC(unittest.TestCase):
238
238
def tearDown(self):
239
239
assert 0, "down1"
@@ -530,19 +530,31 @@ def f(_):
530
530
# will crash both at test time and at teardown
531
531
"""
532
532
)
533
- result = testdir .runpytest ()
533
+ # Ignore DeprecationWarning (for `cmp`) from attrs through twisted,
534
+ # for stable test results.
535
+ result = testdir .runpytest (
536
+ "-vv" , "-oconsole_output_style=classic" , "-W" , "ignore::DeprecationWarning"
537
+ )
534
538
result .stdout .fnmatch_lines (
535
539
[
540
+ "test_trial_error.py::TC::test_four FAILED" ,
541
+ "test_trial_error.py::TC::test_four ERROR" ,
542
+ "test_trial_error.py::TC::test_one FAILED" ,
543
+ "test_trial_error.py::TC::test_three FAILED" ,
544
+ "test_trial_error.py::TC::test_two FAILED" ,
536
545
"*ERRORS*" ,
546
+ "*_ ERROR at teardown of TC.test_four _*" ,
537
547
"*DelayedCalls*" ,
538
- "*test_four*" ,
548
+ "*= FAILURES =*" ,
549
+ "*_ TC.test_four _*" ,
539
550
"*NameError*crash*" ,
540
- "*test_one*" ,
551
+ "*_ TC. test_one _ *" ,
541
552
"*NameError*crash*" ,
542
- "*test_three*" ,
553
+ "*_ TC. test_three _ *" ,
543
554
"*DelayedCalls*" ,
544
- "*test_two*" ,
545
- "*crash*" ,
555
+ "*_ TC.test_two _*" ,
556
+ "*NameError*crash*" ,
557
+ "*= 4 failed, 1 error in *" ,
546
558
]
547
559
)
548
560
0 commit comments