@@ -38,6 +38,8 @@ def pytest_addoption(parser):
3838 parser .addoption ("--regenerate-output" ,
3939 action = "store_true" , default = False ,
4040 help = ("Force regeneration of generated test output" ))
41+ parser .addoption ("--only-rest" , action = "store_true" , default = False )
42+ parser .addoption ("--only-xmlrpc" , action = "store_true" , default = False )
4143
4244
4345def pytest_ignore_collect (path , config ):
@@ -72,6 +74,10 @@ def pytest_configure(config):
7274 # Functional tests need access to HOME cached auth.
7375 # Unit tests shouldn't be touching any HOME files
7476 os .environ ["HOME" ] = os .path .dirname (__file__ ) + "/data/homedir"
77+ if config .getoption ("--only-rest" ):
78+ tests .CLICONFIG .ONLY_REST = True
79+ if config .getoption ("--only-xmlrpc" ):
80+ tests .CLICONFIG .ONLY_XMLRPC = True
7581
7682
7783def pytest_generate_tests (metafunc ):
@@ -80,8 +86,14 @@ def pytest_generate_tests(metafunc):
8086 force_rest=True and force_xmlrpc=True Bugzilla options
8187 """
8288 if 'backends' in metafunc .fixturenames :
83- values = [{"force_xmlrpc" : True }, {"force_rest" : True }]
84- ids = ["XMLRPC" , "REST" ]
89+ values = []
90+ ids = []
91+ if not tests .CLICONFIG .ONLY_REST :
92+ values .append ({"force_xmlrpc" : True })
93+ ids .append ("XMLRPC" )
94+ if not tests .CLICONFIG .ONLY_XMLRPC :
95+ values .append ({"force_rest" : True })
96+ ids .append ("REST" )
8597 metafunc .parametrize ("backends" , values , ids = ids , scope = "session" )
8698
8799
0 commit comments