@@ -807,9 +807,9 @@ def test():
807807def test_fail_extra_reporting (testdir , monkeypatch ):
808808 monkeypatch .setenv ("COLUMNS" , "80" )
809809 testdir .makepyfile ("def test_this(): assert 0, 'this_failed' * 100" )
810- result = testdir .runpytest ()
810+ result = testdir .runpytest ("-rN" )
811811 result .stdout .no_fnmatch_line ("*short test summary*" )
812- result = testdir .runpytest ("-rf" )
812+ result = testdir .runpytest ()
813813 result .stdout .fnmatch_lines (
814814 [
815815 "*test summary*" ,
@@ -918,38 +918,63 @@ def test_this(i):
918918
919919
920920def test_getreportopt ():
921+ from _pytest .terminal import _REPORTCHARS_DEFAULT
922+
921923 class Config :
922924 class Option :
923- reportchars = ""
924- disable_warnings = True
925+ reportchars = _REPORTCHARS_DEFAULT
926+ disable_warnings = False
925927
926928 option = Option ()
927929
928930 config = Config ()
929931
932+ assert _REPORTCHARS_DEFAULT == "fE"
933+
934+ # Default.
935+ assert getreportopt (config ) == "wfE"
936+
930937 config .option .reportchars = "sf"
931- assert getreportopt (config ) == "sf "
938+ assert getreportopt (config ) == "wsf "
932939
933940 config .option .reportchars = "sfxw"
934- assert getreportopt (config ) == "sfx"
941+ assert getreportopt (config ) == "sfxw"
942+
943+ config .option .reportchars = "a"
944+ assert getreportopt (config ) == "sxXwEf"
945+
946+ config .option .reportchars = "N"
947+ assert getreportopt (config ) == ""
948+
949+ config .option .reportchars = "NwfE"
950+ assert getreportopt (config ) == "wfE"
951+
952+ config .option .reportchars = "NfENx"
953+ assert getreportopt (config ) == "x"
935954
936955 # Now with --disable-warnings.
937- config .option .disable_warnings = False
956+ config .option .disable_warnings = True
938957 config .option .reportchars = "a"
939- assert getreportopt (config ) == "sxXwEf" # NOTE: "w" included!
958+ assert getreportopt (config ) == "sxXwEf"
940959
941960 config .option .reportchars = "sfx"
942- assert getreportopt (config ) == "sfxw "
961+ assert getreportopt (config ) == "sfx "
943962
944963 config .option .reportchars = "sfxw"
945- assert getreportopt (config ) == "sfxw "
964+ assert getreportopt (config ) == "sfx "
946965
947966 config .option .reportchars = "a"
948- assert getreportopt (config ) == "sxXwEf" # NOTE: "w" included!
967+ assert getreportopt (config ) == "sxXwEf"
949968
950969 config .option .reportchars = "A"
951970 assert getreportopt (config ) == "PpsxXwEf"
952971
972+ config .option .reportchars = "AN"
973+ assert getreportopt (config ) == ""
974+
975+ config .option .reportchars = "NwfE"
976+ assert getreportopt (config ) == "fE"
977+
953978
954979def test_terminalreporter_reportopt_addopts (testdir ):
955980 testdir .makeini ("[pytest]\n addopts=-rs" )
@@ -1065,7 +1090,7 @@ def test_func():
10651090 )
10661091 for tbopt in ["long" , "short" , "no" ]:
10671092 print ("testing --tb=%s..." % tbopt )
1068- result = testdir .runpytest ("--tb=%s" % tbopt )
1093+ result = testdir .runpytest ("-rN" , "- -tb=%s" % tbopt )
10691094 s = result .stdout .str ()
10701095 if tbopt == "long" :
10711096 assert "print(6*7)" in s
0 commit comments