11import copy
2- import collections
2+ try :
3+ import collections .abc as collections
4+ except ImportError :
5+ import collections
36import logging
47import os
58import platform
@@ -149,7 +152,7 @@ class level seems to work, and I guess it's not that much extra overhead to setu
149152 log_level = logging .INFO
150153 try :
151154 # first see if logging level overridden by user as command line argument
152- log_level_from_option = pytest .config .getoption ("--log-level" )
155+ log_level_from_option = request .config .getoption ("--log-level" )
153156 if log_level_from_option is not None :
154157 log_level = logging .getLevelName (log_level_from_option )
155158 else :
@@ -158,22 +161,22 @@ class level seems to work, and I guess it's not that much extra overhead to setu
158161 # nope, user didn't specify it as a command line argument to pytest, check if
159162 # we have a default in the loaded pytest.ini. Note: words are seperated in variables
160163 # in .ini land with a "_" while the command line arguments use "-"
161- if pytest .config .inicfg .get ("log_level" ) is not None :
162- log_level = logging .getLevelName (pytest .config .inicfg .get ("log_level" ))
164+ if request .config .inicfg .get ("log_level" ) is not None :
165+ log_level = logging .getLevelName (request .config .inicfg .get ("log_level" ))
163166
164167 logging .root .setLevel (log_level )
165168
166169 logging_format = None
167170 try :
168171 # first see if logging level overridden by user as command line argument
169- log_format_from_option = pytest .config .getoption ("--log-format" )
172+ log_format_from_option = request .config .getoption ("--log-format" )
170173 if log_format_from_option is not None :
171174 logging_format = log_format_from_option
172175 else :
173176 raise ValueError
174177 except ValueError :
175- if pytest .config .inicfg .get ("log_format" ) is not None :
176- logging_format = pytest .config .inicfg .get ("log_format" )
178+ if request .config .inicfg .get ("log_format" ) is not None :
179+ logging_format = request .config .inicfg .get ("log_format" )
177180
178181 logging .basicConfig (level = log_level ,
179182 format = logging_format )
@@ -192,8 +195,8 @@ class level seems to work, and I guess it's not that much extra overhead to setu
192195
193196@pytest .fixture (scope = "session" )
194197def log_global_env_facts (fixture_dtest_config , fixture_logging_setup ):
195- if pytest .config .pluginmanager .hasplugin ('junitxml' ):
196- my_junit = getattr (pytest .config , '_xml' , None )
198+ if fixture_dtest_config .config .pluginmanager .hasplugin ('junitxml' ):
199+ my_junit = getattr (fixture_dtest_config .config , '_xml' , None )
197200 my_junit .add_global_property ('USE_VNODES' , fixture_dtest_config .use_vnodes )
198201
199202
0 commit comments