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:
674
674
testsuites .append (suite_node )
675
675
logfile .write (ET .tostring (testsuites , encoding = "unicode" ))
676
676
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 } " )
679
682
680
683
def add_global_property (self , name : str , value : object ) -> None :
681
684
__tracebackhide__ = True
Original file line number Diff line number Diff line change @@ -1822,3 +1822,13 @@ def test_func():
1822
1822
assert junit_logging == "no"
1823
1823
assert len (node .find_by_tag ("system-err" )) == 0
1824
1824
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