@@ -385,21 +385,55 @@ def test_9():
385385
386386 def test_10():
387387 pytest.xfail("It's 🕙 o'clock")
388+
389+ @pytest.mark.skip(
390+ reason="cannot do foobar because baz is missing due to I don't know what"
391+ )
392+ def test_long_skip():
393+ pass
394+
395+ @pytest.mark.xfail(
396+ reason="cannot do foobar because baz is missing due to I don't know what"
397+ )
398+ def test_long_xfail():
399+ print(1 / 0)
388400 """
389401 )
402+
403+ common_output = [
404+ "test_verbose_skip_reason.py::test_1 SKIPPED (123) *" ,
405+ "test_verbose_skip_reason.py::test_2 XPASS (456) *" ,
406+ "test_verbose_skip_reason.py::test_3 XFAIL (789) *" ,
407+ "test_verbose_skip_reason.py::test_4 XFAIL *" ,
408+ "test_verbose_skip_reason.py::test_5 SKIPPED (unconditional skip) *" ,
409+ "test_verbose_skip_reason.py::test_6 XPASS *" ,
410+ "test_verbose_skip_reason.py::test_7 SKIPPED *" ,
411+ "test_verbose_skip_reason.py::test_8 SKIPPED (888 is great) *" ,
412+ "test_verbose_skip_reason.py::test_9 XFAIL *" ,
413+ "test_verbose_skip_reason.py::test_10 XFAIL (It's 🕙 o'clock) *" ,
414+ ]
415+
390416 result = pytester .runpytest ("-v" )
391417 result .stdout .fnmatch_lines (
392- [
393- "test_verbose_skip_reason.py::test_1 SKIPPED (123) *" ,
394- "test_verbose_skip_reason.py::test_2 XPASS (456) *" ,
395- "test_verbose_skip_reason.py::test_3 XFAIL (789) *" ,
396- "test_verbose_skip_reason.py::test_4 XFAIL *" ,
397- "test_verbose_skip_reason.py::test_5 SKIPPED (unconditional skip) *" ,
398- "test_verbose_skip_reason.py::test_6 XPASS *" ,
399- "test_verbose_skip_reason.py::test_7 SKIPPED *" ,
400- "test_verbose_skip_reason.py::test_8 SKIPPED (888 is great) *" ,
401- "test_verbose_skip_reason.py::test_9 XFAIL *" ,
402- "test_verbose_skip_reason.py::test_10 XFAIL (It's 🕙 o'clock) *" ,
418+ common_output
419+ + [
420+ "test_verbose_skip_reason.py::test_long_skip SKIPPED (cannot *...) *" ,
421+ "test_verbose_skip_reason.py::test_long_xfail XFAIL (cannot *...) *" ,
422+ ]
423+ )
424+
425+ result = pytester .runpytest ("-vv" )
426+ result .stdout .fnmatch_lines (
427+ common_output
428+ + [
429+ (
430+ "test_verbose_skip_reason.py::test_long_skip SKIPPED"
431+ " (cannot do foobar because baz is missing due to I don't know what) *"
432+ ),
433+ (
434+ "test_verbose_skip_reason.py::test_long_xfail XFAIL"
435+ " (cannot do foobar because baz is missing due to I don't know what) *"
436+ ),
403437 ]
404438 )
405439
0 commit comments