@@ -326,21 +326,19 @@ def pytest_configure(config):
326326 "markers" ,
327327 "bugzilla(*bug_ids, **guards): Bugzilla integration" ,
328328 )
329-
330- bz = None
331- if config .getvalue ("bugzilla" ) and config .getvalue ('bugzilla_url' ):
332- url = config .getvalue ('bugzilla_url' )
333- if config .getvalue ('bugzilla_username' ) and config .getvalue ('bugzilla_password' ):
334- user = config .getvalue ('bugzilla_username' )
335- password = config .getvalue ('bugzilla_password' )
336- bz = bugzilla .Bugzilla (url = url , user = user , password = password )
337- elif config .getvalue ('bugzilla_api_key' ):
338- api_key = config .getvalue ('bugzilla_api_key' )
329+
330+ url = config .getvalue ('bugzilla_url' )
331+ username = config .getvalue ('bugzilla_username' )
332+ password = config .getvalue ('bugzilla_password' )
333+ api_key = config .getvalue ('bugzilla_api_key' )
334+ if config .getvalue ("bugzilla" ) and url :
335+ if username and password :
336+ bz = bugzilla .Bugzilla (url = url , user = username , password = password )
337+ elif api_key :
339338 bz = bugzilla .Bugzilla (url = url , api_key = api_key )
339+ else :
340+ bz = bugzilla .Bugzilla (url = url )
340341
341- if not bz :
342- raise Exception ('Please specify a valid bugzilla_username + bugzilla_password or a valid bugzilla_api_key' )
343-
344342 version = config .getvalue ('bugzilla_version' )
345343 loose = [
346344 x .strip ()
0 commit comments