11import asyncio
22import gzip
33import json
4+ import sys
45from http .client import HTTPConnection
56from io import BytesIO
67from typing import Tuple
@@ -23,15 +24,30 @@ def request_get(port, path, token, host=LOCALHOST):
2324 return h .getresponse ()
2425
2526
26- @pytest .mark .parametrize (
27- "server_process_path" ,
28- [
29- "/python-http/" ,
27+ PARAMETERIZED_SERVER_PROCESS_PATHS = [
28+ "/python-http/" ,
29+ pytest .param (
3030 "/python-unix-socket-true/" ,
31+ marks = pytest .mark .skipif (
32+ sys .platform == "win32" , reason = "Unix socket not supported on Windows"
33+ ),
34+ ),
35+ pytest .param (
3136 "/python-unix-socket-file/" ,
37+ marks = pytest .mark .skipif (
38+ sys .platform == "win32" , reason = "Unix socket not supported on Windows"
39+ ),
40+ ),
41+ pytest .param (
3242 "/python-unix-socket-file-no-command/" ,
33- ],
34- )
43+ marks = pytest .mark .skipif (
44+ sys .platform == "win32" , reason = "Unix socket not supported on Windows"
45+ ),
46+ ),
47+ ]
48+
49+
50+ @pytest .mark .parametrize ("server_process_path" , PARAMETERIZED_SERVER_PROCESS_PATHS )
3551def test_server_proxy_minimal_proxy_path_encoding (
3652 server_process_path : str , a_server_port_and_token : Tuple [int , str ]
3753) -> None :
@@ -50,15 +66,7 @@ def test_server_proxy_minimal_proxy_path_encoding(
5066 assert f"GET /{ special_path } &token=" in s
5167
5268
53- @pytest .mark .parametrize (
54- "server_process_path" ,
55- [
56- "/python-http/" ,
57- "/python-unix-socket-true/" ,
58- "/python-unix-socket-file/" ,
59- "/python-unix-socket-file-no-command/" ,
60- ],
61- )
69+ @pytest .mark .parametrize ("server_process_path" , PARAMETERIZED_SERVER_PROCESS_PATHS )
6270def test_server_proxy_hash_sign_encoding (
6371 server_process_path : str , a_server_port_and_token : Tuple [int , str ]
6472) -> None :
0 commit comments