Skip to content

Commit 9e2d2b5

Browse files
fix: use threading instead of subprocess for Windows compatibility (#639)
1 parent df8558b commit 9e2d2b5

File tree

8 files changed

+70
-358
lines changed

8 files changed

+70
-358
lines changed

tests/compatibility_suite/test_v1_provider.py

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from __future__ import annotations
66

77
import logging
8-
import sys
98

109
import pytest
1110
from pytest_bdd import given, parsers, scenario
@@ -45,10 +44,6 @@
4544
################################################################################
4645

4746

48-
@pytest.mark.skipif(
49-
sys.platform.startswith("win"),
50-
reason="See pact-foundation/pact-python#639",
51-
)
5247
@scenario(
5348
"definition/features/V1/http_provider.feature",
5449
"Verifying a simple HTTP request",
@@ -57,10 +52,6 @@ def test_verifying_a_simple_http_request() -> None:
5752
"""Verifying a simple HTTP request."""
5853

5954

60-
@pytest.mark.skipif(
61-
sys.platform.startswith("win"),
62-
reason="See pact-foundation/pact-python#639",
63-
)
6455
@scenario(
6556
"definition/features/V1/http_provider.feature",
6657
"Verifying multiple Pact files",
@@ -69,10 +60,6 @@ def test_verifying_multiple_pact_files() -> None:
6960
"""Verifying multiple Pact files."""
7061

7162

72-
@pytest.mark.skipif(
73-
sys.platform.startswith("win"),
74-
reason="See pact-foundation/pact-python#639",
75-
)
7663
@scenario(
7764
"definition/features/V1/http_provider.feature",
7865
"Incorrect request is made to provider",
@@ -81,10 +68,6 @@ def test_incorrect_request_is_made_to_provider() -> None:
8168
"""Incorrect request is made to provider."""
8269

8370

84-
@pytest.mark.skipif(
85-
sys.platform.startswith("win"),
86-
reason="See pact-foundation/pact-python#639",
87-
)
8871
@pytest.mark.container
8972
@scenario(
9073
"definition/features/V1/http_provider.feature",
@@ -94,10 +77,6 @@ def test_verifying_a_simple_http_request_via_a_pact_broker() -> None:
9477
"""Verifying a simple HTTP request via a Pact broker."""
9578

9679

97-
@pytest.mark.skipif(
98-
sys.platform.startswith("win"),
99-
reason="See pact-foundation/pact-python#639",
100-
)
10180
@pytest.mark.container
10281
@scenario(
10382
"definition/features/V1/http_provider.feature",
@@ -107,10 +86,6 @@ def test_verifying_a_simple_http_request_via_a_pact_broker_with_publishing() ->
10786
"""Verifying a simple HTTP request via a Pact broker with publishing."""
10887

10988

110-
@pytest.mark.skipif(
111-
sys.platform.startswith("win"),
112-
reason="See pact-foundation/pact-python#639",
113-
)
11489
@pytest.mark.container
11590
@scenario(
11691
"definition/features/V1/http_provider.feature",
@@ -120,10 +95,6 @@ def test_verifying_multiple_pact_files_via_a_pact_broker() -> None:
12095
"""Verifying multiple Pact files via a Pact broker."""
12196

12297

123-
@pytest.mark.skipif(
124-
sys.platform.startswith("win"),
125-
reason="See pact-foundation/pact-python#639",
126-
)
12798
@pytest.mark.container
12899
@scenario(
129100
"definition/features/V1/http_provider.feature",
@@ -133,10 +104,6 @@ def test_incorrect_request_is_made_to_provider_via_a_pact_broker() -> None:
133104
"""Incorrect request is made to provider via a Pact broker."""
134105

135106

136-
@pytest.mark.skipif(
137-
sys.platform.startswith("win"),
138-
reason="See pact-foundation/pact-python#639",
139-
)
140107
@scenario(
141108
"definition/features/V1/http_provider.feature",
142109
"Verifying an interaction with a defined provider state",
@@ -145,10 +112,6 @@ def test_verifying_an_interaction_with_a_defined_provider_state() -> None:
145112
"""Verifying an interaction with a defined provider state."""
146113

147114

148-
@pytest.mark.skipif(
149-
sys.platform.startswith("win"),
150-
reason="See pact-foundation/pact-python#639",
151-
)
152115
@scenario(
153116
"definition/features/V1/http_provider.feature",
154117
"Verifying an interaction with no defined provider state",
@@ -157,10 +120,6 @@ def test_verifying_an_interaction_with_no_defined_provider_state() -> None:
157120
"""Verifying an interaction with no defined provider state."""
158121

159122

160-
@pytest.mark.skipif(
161-
sys.platform.startswith("win"),
162-
reason="See pact-foundation/pact-python#639",
163-
)
164123
@scenario(
165124
"definition/features/V1/http_provider.feature",
166125
"Verifying an interaction where the provider state callback fails",
@@ -169,10 +128,6 @@ def test_verifying_an_interaction_where_the_provider_state_callback_fails() -> N
169128
"""Verifying an interaction where the provider state callback fails."""
170129

171130

172-
@pytest.mark.skipif(
173-
sys.platform.startswith("win"),
174-
reason="See pact-foundation/pact-python#639",
175-
)
176131
@scenario(
177132
"definition/features/V1/http_provider.feature",
178133
"Verifying an interaction where a provider state callback is not configured",
@@ -181,10 +136,6 @@ def test_verifying_an_interaction_where_no_provider_state_callback_configured()
181136
"""Verifying an interaction where a provider state callback is not configured."""
182137

183138

184-
@pytest.mark.skipif(
185-
sys.platform.startswith("win"),
186-
reason="See pact-foundation/pact-python#639",
187-
)
188139
@scenario(
189140
"definition/features/V1/http_provider.feature",
190141
"Verifying a HTTP request with a request filter configured",
@@ -193,10 +144,6 @@ def test_verifying_a_http_request_with_a_request_filter_configured() -> None:
193144
"""Verifying a HTTP request with a request filter configured."""
194145

195146

196-
@pytest.mark.skipif(
197-
sys.platform.startswith("win"),
198-
reason="See pact-foundation/pact-python#639",
199-
)
200147
@scenario(
201148
"definition/features/V1/http_provider.feature",
202149
"Verifies the response status code",
@@ -205,10 +152,6 @@ def test_verifies_the_response_status_code() -> None:
205152
"""Verifies the response status code."""
206153

207154

208-
@pytest.mark.skipif(
209-
sys.platform.startswith("win"),
210-
reason="See pact-foundation/pact-python#639",
211-
)
212155
@scenario(
213156
"definition/features/V1/http_provider.feature",
214157
"Verifies the response headers",
@@ -217,10 +160,6 @@ def test_verifies_the_response_headers() -> None:
217160
"""Verifies the response headers."""
218161

219162

220-
@pytest.mark.skipif(
221-
sys.platform.startswith("win"),
222-
reason="See pact-foundation/pact-python#639",
223-
)
224163
@scenario(
225164
"definition/features/V1/http_provider.feature",
226165
"Response with plain text body (positive case)",
@@ -229,10 +168,6 @@ def test_response_with_plain_text_body_positive_case() -> None:
229168
"""Response with plain text body (positive case)."""
230169

231170

232-
@pytest.mark.skipif(
233-
sys.platform.startswith("win"),
234-
reason="See pact-foundation/pact-python#639",
235-
)
236171
@scenario(
237172
"definition/features/V1/http_provider.feature",
238173
"Response with plain text body (negative case)",
@@ -241,10 +176,6 @@ def test_response_with_plain_text_body_negative_case() -> None:
241176
"""Response with plain text body (negative case)."""
242177

243178

244-
@pytest.mark.skipif(
245-
sys.platform.startswith("win"),
246-
reason="See pact-foundation/pact-python#639",
247-
)
248179
@scenario(
249180
"definition/features/V1/http_provider.feature",
250181
"Response with JSON body (positive case)",
@@ -253,10 +184,6 @@ def test_response_with_json_body_positive_case() -> None:
253184
"""Response with JSON body (positive case)."""
254185

255186

256-
@pytest.mark.skipif(
257-
sys.platform.startswith("win"),
258-
reason="See pact-foundation/pact-python#639",
259-
)
260187
@scenario(
261188
"definition/features/V1/http_provider.feature",
262189
"Response with JSON body (negative case)",
@@ -265,10 +192,6 @@ def test_response_with_json_body_negative_case() -> None:
265192
"""Response with JSON body (negative case)."""
266193

267194

268-
@pytest.mark.skipif(
269-
sys.platform.startswith("win"),
270-
reason="See pact-foundation/pact-python#639",
271-
)
272195
@scenario(
273196
"definition/features/V1/http_provider.feature",
274197
"Response with XML body (positive case)",
@@ -277,10 +200,6 @@ def test_response_with_xml_body_positive_case() -> None:
277200
"""Response with XML body (positive case)."""
278201

279202

280-
@pytest.mark.skipif(
281-
sys.platform.startswith("win"),
282-
reason="See pact-foundation/pact-python#639",
283-
)
284203
@scenario(
285204
"definition/features/V1/http_provider.feature",
286205
"Response with XML body (negative case)",
@@ -289,10 +208,6 @@ def test_response_with_xml_body_negative_case() -> None:
289208
"""Response with XML body (negative case)."""
290209

291210

292-
@pytest.mark.skipif(
293-
sys.platform.startswith("win"),
294-
reason="See pact-foundation/pact-python#639",
295-
)
296211
@scenario(
297212
"definition/features/V1/http_provider.feature",
298213
"Response with binary body (positive case)",
@@ -301,10 +216,6 @@ def test_response_with_binary_body_positive_case() -> None:
301216
"""Response with binary body (positive case)."""
302217

303218

304-
@pytest.mark.skipif(
305-
sys.platform.startswith("win"),
306-
reason="See pact-foundation/pact-python#639",
307-
)
308219
@scenario(
309220
"definition/features/V1/http_provider.feature",
310221
"Response with binary body (negative case)",
@@ -313,10 +224,6 @@ def test_response_with_binary_body_negative_case() -> None:
313224
"""Response with binary body (negative case)."""
314225

315226

316-
@pytest.mark.skipif(
317-
sys.platform.startswith("win"),
318-
reason="See pact-foundation/pact-python#639",
319-
)
320227
@scenario(
321228
"definition/features/V1/http_provider.feature",
322229
"Response with form post body (positive case)",
@@ -325,10 +232,6 @@ def test_response_with_form_post_body_positive_case() -> None:
325232
"""Response with form post body (positive case)."""
326233

327234

328-
@pytest.mark.skipif(
329-
sys.platform.startswith("win"),
330-
reason="See pact-foundation/pact-python#639",
331-
)
332235
@scenario(
333236
"definition/features/V1/http_provider.feature",
334237
"Response with form post body (negative case)",
@@ -337,10 +240,6 @@ def test_response_with_form_post_body_negative_case() -> None:
337240
"""Response with form post body (negative case)."""
338241

339242

340-
@pytest.mark.skipif(
341-
sys.platform.startswith("win"),
342-
reason="See pact-foundation/pact-python#639",
343-
)
344243
@scenario(
345244
"definition/features/V1/http_provider.feature",
346245
"Response with multipart body (positive case)",
@@ -349,10 +248,6 @@ def test_response_with_multipart_body_positive_case() -> None:
349248
"""Response with multipart body (positive case)."""
350249

351250

352-
@pytest.mark.skipif(
353-
sys.platform.startswith("win"),
354-
reason="See pact-foundation/pact-python#639",
355-
)
356251
@scenario(
357252
"definition/features/V1/http_provider.feature",
358253
"Response with multipart body (negative case)",

tests/compatibility_suite/test_v2_provider.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
from __future__ import annotations
66

77
import logging
8-
import sys
98

10-
import pytest
119
from pytest_bdd import given, parsers, scenario
1210

1311
from tests.compatibility_suite.util import parse_horizontal_table
@@ -30,10 +28,6 @@
3028
################################################################################
3129

3230

33-
@pytest.mark.skipif(
34-
sys.platform.startswith("win"),
35-
reason="See pact-foundation/pact-python#639",
36-
)
3731
@scenario(
3832
"definition/features/V2/http_provider.feature",
3933
"Supports matching rules for the response headers (positive case)",
@@ -44,10 +38,6 @@ def test_supports_matching_rules_for_the_response_headers_positive_case() -> Non
4438
"""
4539

4640

47-
@pytest.mark.skipif(
48-
sys.platform.startswith("win"),
49-
reason="See pact-foundation/pact-python#639",
50-
)
5141
@scenario(
5242
"definition/features/V2/http_provider.feature",
5343
"Supports matching rules for the response headers (negative case)",
@@ -58,10 +48,6 @@ def test_supports_matching_rules_for_the_response_headers_negative_case() -> Non
5848
"""
5949

6050

61-
@pytest.mark.skipif(
62-
sys.platform.startswith("win"),
63-
reason="See pact-foundation/pact-python#639",
64-
)
6551
@scenario(
6652
"definition/features/V2/http_provider.feature",
6753
"Verifies the response body (positive case)",
@@ -72,10 +58,6 @@ def test_verifies_the_response_body_positive_case() -> None:
7258
"""
7359

7460

75-
@pytest.mark.skipif(
76-
sys.platform.startswith("win"),
77-
reason="See pact-foundation/pact-python#639",
78-
)
7961
@scenario(
8062
"definition/features/V2/http_provider.feature",
8163
"Verifies the response body (negative case)",

0 commit comments

Comments
 (0)