File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ `--junitxml ` no longer prints the `generated xml file ` summary at the end of the pytest session when `--quiet ` is given.
Original file line number Diff line number Diff line change @@ -674,8 +674,11 @@ def pytest_sessionfinish(self) -> None:
674674 testsuites .append (suite_node )
675675 logfile .write (ET .tostring (testsuites , encoding = "unicode" ))
676676
677- def pytest_terminal_summary (self , terminalreporter : TerminalReporter ) -> None :
678- terminalreporter .write_sep ("-" , f"generated xml file: { self .logfile } " )
677+ def pytest_terminal_summary (
678+ self , terminalreporter : TerminalReporter , config : pytest .Config
679+ ) -> None :
680+ if config .get_verbosity () >= 0 :
681+ terminalreporter .write_sep ("-" , f"generated xml file: { self .logfile } " )
679682
680683 def add_global_property (self , name : str , value : object ) -> None :
681684 __tracebackhide__ = True
Original file line number Diff line number Diff line change @@ -1822,3 +1822,13 @@ def test_func():
18221822 assert junit_logging == "no"
18231823 assert len (node .find_by_tag ("system-err" )) == 0
18241824 assert len (node .find_by_tag ("system-out" )) == 0
1825+
1826+
1827+ def test_no_message_quiet (pytester : Pytester ) -> None :
1828+ """Do not show the summary banner when --quiet is given (#13700)."""
1829+ pytester .makepyfile ("def test(): pass" )
1830+ result = pytester .runpytest ("--junitxml=pytest.xml" )
1831+ result .stdout .fnmatch_lines ("* generated xml file: *" )
1832+
1833+ result = pytester .runpytest ("--junitxml=pytest.xml" , "--quiet" )
1834+ result .stdout .no_fnmatch_line ("* generated xml file: *" )
You can’t perform that action at this time.
0 commit comments