@@ -814,9 +814,9 @@ def test():
814814def test_fail_extra_reporting (testdir , monkeypatch ):
815815 monkeypatch .setenv ("COLUMNS" , "80" )
816816 testdir .makepyfile ("def test_this(): assert 0, 'this_failed' * 100" )
817- result = testdir .runpytest ()
817+ result = testdir .runpytest ("-rN" )
818818 result .stdout .no_fnmatch_line ("*short test summary*" )
819- result = testdir .runpytest ("-rf" )
819+ result = testdir .runpytest ()
820820 result .stdout .fnmatch_lines (
821821 [
822822 "*test summary*" ,
@@ -985,37 +985,62 @@ def test_this(i):
985985
986986
987987def test_getreportopt ():
988+ from _pytest .terminal import _REPORTCHARS_DEFAULT
989+
988990 class Config :
989991 class Option :
990- reportchars = ""
991- disable_warnings = True
992+ reportchars = _REPORTCHARS_DEFAULT
993+ disable_warnings = False
992994
993995 option = Option ()
994996
995997 config = Config ()
996998
999+ assert _REPORTCHARS_DEFAULT == "fE"
1000+
1001+ # Default.
1002+ assert getreportopt (config ) == "wfE"
1003+
9971004 config .option .reportchars = "sf"
998- assert getreportopt (config ) == "sf "
1005+ assert getreportopt (config ) == "wsf "
9991006
10001007 config .option .reportchars = "sfxw"
1001- assert getreportopt (config ) == "sfx"
1008+ assert getreportopt (config ) == "sfxw"
1009+
1010+ config .option .reportchars = "a"
1011+ assert getreportopt (config ) == "wsxXEf"
1012+
1013+ config .option .reportchars = "N"
1014+ assert getreportopt (config ) == "w"
1015+
1016+ config .option .reportchars = "NwfE"
1017+ assert getreportopt (config ) == "wfE"
1018+
1019+ config .option .reportchars = "NfENx"
1020+ assert getreportopt (config ) == "wx"
10021021
10031022 # Now with --disable-warnings.
1004- config .option .disable_warnings = False
1023+ config .option .disable_warnings = True
10051024 config .option .reportchars = "a"
1006- assert getreportopt (config ) == "sxXwEf" # NOTE: "w" included!
1025+ assert getreportopt (config ) == "sxXEf"
10071026
10081027 config .option .reportchars = "sfx"
1009- assert getreportopt (config ) == "sfxw "
1028+ assert getreportopt (config ) == "sfx "
10101029
10111030 config .option .reportchars = "sfxw"
1012- assert getreportopt (config ) == "sfxw "
1031+ assert getreportopt (config ) == "sfx "
10131032
10141033 config .option .reportchars = "a"
1015- assert getreportopt (config ) == "sxXwEf" # NOTE: "w" included!
1034+ assert getreportopt (config ) == "sxXEf"
10161035
10171036 config .option .reportchars = "A"
1018- assert getreportopt (config ) == "PpsxXwEf"
1037+ assert getreportopt (config ) == "PpsxXEf"
1038+
1039+ config .option .reportchars = "AN"
1040+ assert getreportopt (config ) == ""
1041+
1042+ config .option .reportchars = "NwfE"
1043+ assert getreportopt (config ) == "fE"
10191044
10201045
10211046def test_terminalreporter_reportopt_addopts (testdir ):
@@ -1132,7 +1157,7 @@ def test_func():
11321157 )
11331158 for tbopt in ["long" , "short" , "no" ]:
11341159 print ("testing --tb=%s..." % tbopt )
1135- result = testdir .runpytest ("--tb=%s" % tbopt )
1160+ result = testdir .runpytest ("-rN" , "- -tb=%s" % tbopt )
11361161 s = result .stdout .str ()
11371162 if tbopt == "long" :
11381163 assert "print(6*7)" in s
0 commit comments