@@ -537,24 +537,28 @@ def f(_):
537
537
)
538
538
result .stdout .fnmatch_lines (
539
539
[
540
- "test_trial_error.py::TC::test_four FAILED " ,
540
+ "test_trial_error.py::TC::test_four SKIPPED " ,
541
541
"test_trial_error.py::TC::test_four ERROR" ,
542
542
"test_trial_error.py::TC::test_one FAILED" ,
543
543
"test_trial_error.py::TC::test_three FAILED" ,
544
- "test_trial_error.py::TC::test_two FAILED" ,
544
+ "test_trial_error.py::TC::test_two SKIPPED" ,
545
+ "test_trial_error.py::TC::test_two ERROR" ,
545
546
"*ERRORS*" ,
546
547
"*_ ERROR at teardown of TC.test_four _*" ,
548
+ "NOTE: Incompatible Exception Representation, displaying natively:" ,
549
+ "*DelayedCalls*" ,
550
+ "*_ ERROR at teardown of TC.test_two _*" ,
551
+ "NOTE: Incompatible Exception Representation, displaying natively:" ,
547
552
"*DelayedCalls*" ,
548
553
"*= FAILURES =*" ,
549
- "*_ TC.test_four _*" ,
550
- "*NameError*crash*" ,
554
+ # "*_ TC.test_four _*",
555
+ # "*NameError*crash*",
551
556
"*_ TC.test_one _*" ,
552
557
"*NameError*crash*" ,
553
558
"*_ TC.test_three _*" ,
559
+ "NOTE: Incompatible Exception Representation, displaying natively:" ,
554
560
"*DelayedCalls*" ,
555
- "*_ TC.test_two _*" ,
556
- "*NameError*crash*" ,
557
- "*= 4 failed, 1 error in *" ,
561
+ "*= 2 failed, 2 skipped, 2 errors in *" ,
558
562
]
559
563
)
560
564
@@ -1096,3 +1100,26 @@ def test_should_not_run(self):
1096
1100
)
1097
1101
result = testdir .runpytest ()
1098
1102
result .stdout .fnmatch_lines (["*Exit: pytest_exit called*" , "*= no tests ran in *" ])
1103
+
1104
+
1105
+ def test_trace (testdir ):
1106
+ p1 = testdir .makepyfile (
1107
+ """
1108
+ import unittest
1109
+
1110
+ class MyTestCase(unittest.TestCase):
1111
+ def test(self):
1112
+ self.assertEqual('foo', 'foo')
1113
+ """
1114
+ )
1115
+ result = testdir .runpytest ("--trace" , str (p1 ))
1116
+ result .stdout .fnmatch_lines (
1117
+ [
1118
+ "self = <test_trace.MyTestCase testMethod=_wrapped_testMethod>" ,
1119
+ " def test(self):" ,
1120
+ "> self.assertEqual('foo', 'foo')" ,
1121
+ "test_trace.py:5: " ,
1122
+ "* in trace_dispatch" ,
1123
+ ]
1124
+ )
1125
+ assert result .ret == ExitCode .TESTS_FAILED
0 commit comments