File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -479,6 +479,31 @@ def test_foo(self):
479479 result = pytester .runpytest ()
480480 result .stdout .fnmatch_lines (["* 1 passed in *" ])
481481
482+ def test_non_subtest_skip (
483+ self , pytester : pytest .Pytester , monkeypatch : pytest .MonkeyPatch
484+ ) -> None :
485+ monkeypatch .setenv ("COLUMNS" , "120" )
486+ pytester .makepyfile (
487+ """
488+ from unittest import TestCase, main
489+
490+ class T(TestCase):
491+
492+ def test_foo(self):
493+ with self.subTest(msg="subtest"):
494+ assert False, "failed subtest"
495+ self.skipTest('non-subtest skip')
496+ """
497+ )
498+ # This output might change #13756.
499+ result = pytester .runpytest ()
500+ result .stdout .fnmatch_lines (
501+ [
502+ "SUBFAILED[[]subtest[]] test_non_subtest_skip.py::T::test_foo*" ,
503+ "* 1 failed, 1 skipped in *" ,
504+ ]
505+ )
506+
482507 def test_xfail (
483508 self ,
484509 pytester : pytest .Pytester ,
You can’t perform that action at this time.
0 commit comments