@@ -813,9 +813,9 @@ def test():
813813def test_fail_extra_reporting (testdir , monkeypatch ):
814814 monkeypatch .setenv ("COLUMNS" , "80" )
815815 testdir .makepyfile ("def test_this(): assert 0, 'this_failed' * 100" )
816- result = testdir .runpytest ()
816+ result = testdir .runpytest ("-rN" )
817817 result .stdout .no_fnmatch_line ("*short test summary*" )
818- result = testdir .runpytest ("-rf" )
818+ result = testdir .runpytest ()
819819 result .stdout .fnmatch_lines (
820820 [
821821 "*test summary*" ,
@@ -984,37 +984,62 @@ def test_this(i):
984984
985985
986986def test_getreportopt ():
987+ from _pytest .terminal import _REPORTCHARS_DEFAULT
988+
987989 class Config :
988990 class Option :
989- reportchars = ""
990- disable_warnings = True
991+ reportchars = _REPORTCHARS_DEFAULT
992+ disable_warnings = False
991993
992994 option = Option ()
993995
994996 config = Config ()
995997
998+ assert _REPORTCHARS_DEFAULT == "fE"
999+
1000+ # Default.
1001+ assert getreportopt (config ) == "wfE"
1002+
9961003 config .option .reportchars = "sf"
997- assert getreportopt (config ) == "sf "
1004+ assert getreportopt (config ) == "wsf "
9981005
9991006 config .option .reportchars = "sfxw"
1000- assert getreportopt (config ) == "sfx"
1007+ assert getreportopt (config ) == "sfxw"
1008+
1009+ config .option .reportchars = "a"
1010+ assert getreportopt (config ) == "wsxXEf"
1011+
1012+ config .option .reportchars = "N"
1013+ assert getreportopt (config ) == "w"
1014+
1015+ config .option .reportchars = "NwfE"
1016+ assert getreportopt (config ) == "wfE"
1017+
1018+ config .option .reportchars = "NfENx"
1019+ assert getreportopt (config ) == "wx"
10011020
10021021 # Now with --disable-warnings.
1003- config .option .disable_warnings = False
1022+ config .option .disable_warnings = True
10041023 config .option .reportchars = "a"
1005- assert getreportopt (config ) == "sxXwEf" # NOTE: "w" included!
1024+ assert getreportopt (config ) == "sxXEf"
10061025
10071026 config .option .reportchars = "sfx"
1008- assert getreportopt (config ) == "sfxw "
1027+ assert getreportopt (config ) == "sfx "
10091028
10101029 config .option .reportchars = "sfxw"
1011- assert getreportopt (config ) == "sfxw "
1030+ assert getreportopt (config ) == "sfx "
10121031
10131032 config .option .reportchars = "a"
1014- assert getreportopt (config ) == "sxXwEf" # NOTE: "w" included!
1033+ assert getreportopt (config ) == "sxXEf"
10151034
10161035 config .option .reportchars = "A"
1017- assert getreportopt (config ) == "PpsxXwEf"
1036+ assert getreportopt (config ) == "PpsxXEf"
1037+
1038+ config .option .reportchars = "AN"
1039+ assert getreportopt (config ) == ""
1040+
1041+ config .option .reportchars = "NwfE"
1042+ assert getreportopt (config ) == "fE"
10181043
10191044
10201045def test_terminalreporter_reportopt_addopts (testdir ):
@@ -1131,7 +1156,7 @@ def test_func():
11311156 )
11321157 for tbopt in ["long" , "short" , "no" ]:
11331158 print ("testing --tb=%s..." % tbopt )
1134- result = testdir .runpytest ("--tb=%s" % tbopt )
1159+ result = testdir .runpytest ("-rN" , "- -tb=%s" % tbopt )
11351160 s = result .stdout .str ()
11361161 if tbopt == "long" :
11371162 assert "print(6*7)" in s
0 commit comments