@@ -31,6 +31,17 @@ def stop(self):
3131 Plugin .PROXY = None
3232
3333
34+ @pytest .fixture (scope = "session" )
35+ def plugin_httpserver_class ():
36+ yield PluginHTTPServer
37+
38+
39+ @pytest .fixture (scope = "session" )
40+ def plugin_proxy_class ():
41+ print ("plugin_proxy_class" )
42+ yield PluginHTTPProxy
43+
44+
3445def get_httpserver_listen_address ():
3546 listen_host = os .environ .get ("PYTEST_HTTPSERVER_HOST" )
3647 listen_port = os .environ .get ("PYTEST_HTTPSERVER_PORT" )
@@ -46,7 +57,7 @@ def httpserver_listen_address():
4657
4758
4859@pytest .fixture
49- def httpserver (httpserver_listen_address ):
60+ def httpserver (httpserver_listen_address , plugin_httpserver_class ):
5061 if Plugin .SERVER :
5162 Plugin .SERVER .clear ()
5263 yield Plugin .SERVER
@@ -58,13 +69,13 @@ def httpserver(httpserver_listen_address):
5869 if not port :
5970 port = HTTPServer .DEFAULT_LISTEN_PORT
6071
61- server = PluginHTTPServer (host = host , port = port )
72+ server = plugin_httpserver_class (host = host , port = port )
6273 server .start ()
6374 yield server
6475
6576
6677@pytest .fixture
67- def httpproxy (httpserver_listen_address , tmp_path ):
78+ def httpproxy (httpserver_listen_address , tmp_path , plugin_proxy_class ):
6879 if Plugin .PROXY :
6980 Plugin .PROXY .clear ()
7081 yield Plugin .PROXY
@@ -78,7 +89,7 @@ def httpproxy(httpserver_listen_address, tmp_path):
7889
7990 ca_dir = tmp_path .joinpath ("httpproxy_ca" )
8091 ca_dir .mkdir (exist_ok = True )
81- server = PluginHTTPProxy (host = host , port = port , proxy_options = {"ca_file_cache" : str (ca_dir .joinpath ("wsgiprox-ca.pem" ))})
92+ server = plugin_proxy_class (host = host , port = port , proxy_options = {"ca_file_cache" : str (ca_dir .joinpath ("wsgiprox-ca.pem" ))})
8293 server .start ()
8394 yield server
8495
0 commit comments