File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1+ ``-q `` has again an impact on the style of the collected items
2+ (``--collect-only ``) when ``--log-cli-level `` is used.
Original file line number Diff line number Diff line change @@ -409,10 +409,6 @@ def __init__(self, config):
409409 """
410410 self ._config = config
411411
412- # enable verbose output automatically if live logging is enabled
413- if self ._log_cli_enabled () and config .getoption ("verbose" ) < 1 :
414- config .option .verbose = 1
415-
416412 self .print_logs = get_option_ini (config , "log_print" )
417413 self .formatter = self ._create_formatter (
418414 get_option_ini (config , "log_format" ),
@@ -628,6 +624,10 @@ def pytest_sessionstart(self):
628624 @pytest .hookimpl (hookwrapper = True )
629625 def pytest_runtestloop (self , session ):
630626 """Runs all collected test items."""
627+ if self ._log_cli_enabled () and self ._config .getoption ("verbose" ) < 1 :
628+ # setting verbose flag is needed to avoid messy test progress output
629+ self ._config .option .verbose = 1
630+
631631 with self .live_logs_context ():
632632 if self .log_file_handler is not None :
633633 with catching_logs (self .log_file_handler , level = self .log_file_level ):
Original file line number Diff line number Diff line change @@ -916,12 +916,7 @@ def test_collection_live_logging(testdir):
916916
917917 result = testdir .runpytest ("--log-cli-level=INFO" )
918918 result .stdout .fnmatch_lines (
919- [
920- "collecting*" ,
921- "*--- live log collection ---*" ,
922- "*Normal message*" ,
923- "collected 0 items" ,
924- ]
919+ ["*--- live log collection ---*" , "*Normal message*" , "collected 0 items" ]
925920 )
926921
927922
You can’t perform that action at this time.
0 commit comments