Skip to content

Commit 2a3a0d2

Browse files
committed
chore(spyne): Add spyne to requirements
- Spyne only supports python < 3.12 Signed-off-by: Varsha GS <[email protected]>
1 parent c8e61fd commit 2a3a0d2

File tree

3 files changed

+50
-44
lines changed

3 files changed

+50
-44
lines changed

tests/conftest.py

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
if not os.environ.get("KAFKA_TEST"):
4646
collect_ignore_glob.append("*kafka/test*")
4747

48+
if sys.version_info >= (3, 12):
49+
# Currently Spyne does not support python > 3.12
50+
collect_ignore_glob.append("*test_spyne*")
51+
52+
4853
if sys.version_info >= (3, 13):
4954
# Currently not installable dependencies because of 3.13 incompatibilities
5055
collect_ignore_glob.append("*test_sanic*")

tests/frameworks/test_spyne.py

+43-43
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_get_request(self) -> None:
4343
test_span = spans[2]
4444

4545
assert response
46-
assert 200 == response.status
46+
assert response.status == 200
4747

4848
assert "X-INSTANA-T" in response.headers
4949
assert int(response.headers["X-INSTANA-T"], 16)
@@ -78,13 +78,13 @@ def test_get_request(self) -> None:
7878
assert spyne_span.ec is None
7979

8080
# spyne
81-
assert "spyne" == spyne_span.n
81+
assert spyne_span.n == "spyne"
8282
assert (
8383
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
8484
)
85-
assert "/hello" == spyne_span.data["http"]["url"]
86-
assert "GET" == spyne_span.data["http"]["method"]
87-
assert 200 == spyne_span.data["http"]["status"]
85+
assert spyne_span.data["http"]["url"] == "/hello"
86+
assert spyne_span.data["http"]["method"] == "GET"
87+
assert spyne_span.data["http"]["status"] == 200
8888
assert spyne_span.data["http"]["error"] is None
8989
assert spyne_span.stack is None
9090

@@ -102,7 +102,7 @@ def test_secret_scrubbing(self) -> None:
102102
test_span = spans[2]
103103

104104
assert response
105-
assert 200 == response.status
105+
assert response.status == 200
106106

107107
assert "X-INSTANA-T" in response.headers
108108
assert int(response.headers["X-INSTANA-T"], 16)
@@ -137,14 +137,14 @@ def test_secret_scrubbing(self) -> None:
137137
assert spyne_span.ec is None
138138

139139
# spyne
140-
assert "spyne" == spyne_span.n
140+
assert spyne_span.n == "spyne"
141141
assert (
142142
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
143143
)
144-
assert "/say_hello" == spyne_span.data["http"]["url"]
144+
assert spyne_span.data["http"]["url"] == "/say_hello"
145145
assert spyne_span.data["http"]["params"] == "name=World&times=4&secret=<redacted>"
146-
assert "GET" == spyne_span.data["http"]["method"]
147-
assert 200 == spyne_span.data["http"]["status"]
146+
assert spyne_span.data["http"]["method"] == "GET"
147+
assert spyne_span.data["http"]["status"] == 200
148148
assert spyne_span.data["http"]["error"] is None
149149
assert spyne_span.stack is None
150150

@@ -169,7 +169,7 @@ def test_request_header_capture(self) -> None:
169169
urllib3_span = spans[1]
170170
test_span = spans[2]
171171

172-
assert 200 == response.status
172+
assert response.status == 200
173173

174174
assert "X-INSTANA-T" in response.headers
175175
assert int(response.headers["X-INSTANA-T"], 16)
@@ -204,13 +204,13 @@ def test_request_header_capture(self) -> None:
204204
assert spyne_span.ec is None
205205

206206
# spyne
207-
assert "spyne" == spyne_span.n
207+
assert spyne_span.n == "spyne"
208208
assert (
209209
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
210210
)
211-
assert "/hello" == spyne_span.data["http"]["url"]
212-
assert "GET" == spyne_span.data["http"]["method"]
213-
assert 200 == spyne_span.data["http"]["status"]
211+
assert spyne_span.data["http"]["url"] == "/hello"
212+
assert spyne_span.data["http"]["method"] == "GET"
213+
assert spyne_span.data["http"]["status"] == 200
214214
assert spyne_span.data["http"]["error"] is None
215215
assert spyne_span.stack is None
216216

@@ -238,7 +238,7 @@ def test_response_header_capture(self) -> None:
238238
urllib3_span = spans[1]
239239
test_span = spans[2]
240240

241-
assert 200 == response.status
241+
assert response.status == 200
242242

243243
assert "X-INSTANA-T" in response.headers
244244
assert int(response.headers["X-INSTANA-T"], 16)
@@ -274,13 +274,13 @@ def test_response_header_capture(self) -> None:
274274
assert spyne_span.ec is None
275275

276276
# spyne
277-
assert "spyne" == spyne_span.n
277+
assert spyne_span.n == "spyne"
278278
assert (
279279
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
280280
)
281-
assert "/response_headers" == spyne_span.data["http"]["url"]
282-
assert "GET" == spyne_span.data["http"]["method"]
283-
assert 200 == spyne_span.data["http"]["status"]
281+
assert spyne_span.data["http"]["url"] == "/response_headers"
282+
assert spyne_span.data["http"]["method"] == "GET"
283+
assert spyne_span.data["http"]["status"] == 200
284284
assert spyne_span.data["http"]["error"] is None
285285
assert spyne_span.stack is None
286286

@@ -307,7 +307,7 @@ def test_custom_404(self) -> None:
307307
test_span = spans[3]
308308

309309
assert response
310-
assert 404 == response.status
310+
assert response.status == 404
311311

312312
assert "X-INSTANA-T" in response.headers
313313
assert int(response.headers["X-INSTANA-T"], 16)
@@ -343,24 +343,24 @@ def test_custom_404(self) -> None:
343343
assert spyne_span.ec is None
344344

345345
# spyne
346-
assert "spyne" == spyne_span.n
346+
assert spyne_span.n == "spyne"
347347
assert (
348348
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
349349
)
350-
assert "/custom_404" == spyne_span.data["http"]["url"]
351-
assert "GET" == spyne_span.data["http"]["method"]
352-
assert 404 == spyne_span.data["http"]["status"]
350+
assert spyne_span.data["http"]["url"] == "/custom_404"
351+
assert spyne_span.data["http"]["method"] == "GET"
352+
assert spyne_span.data["http"]["status"] == 404
353353
assert spyne_span.data["http"]["error"] is None
354354
assert spyne_span.stack is None
355355

356356
# urllib3
357-
assert "test" == test_span.data["sdk"]["name"]
358-
assert "urllib3" == urllib3_span.n
359-
assert 404 == urllib3_span.data["http"]["status"]
357+
assert test_span.data["sdk"]["name"] == "test"
358+
assert urllib3_span.n == "urllib3"
359+
assert urllib3_span.data["http"]["status"] == 404
360360
assert (
361361
testenv["spyne_server"] + "/custom_404" == urllib3_span.data["http"]["url"]
362362
)
363-
assert "GET" == urllib3_span.data["http"]["method"]
363+
assert urllib3_span.data["http"]["method"] == "GET"
364364
assert urllib3_span.stack is not None
365365
assert type(urllib3_span.stack) is list
366366
assert len(urllib3_span.stack) > 1
@@ -379,7 +379,7 @@ def test_404(self) -> None:
379379
test_span = spans[2]
380380

381381
assert response
382-
assert 404 == response.status
382+
assert response.status == 404
383383

384384
assert "X-INSTANA-T" in response.headers
385385
assert int(response.headers["X-INSTANA-T"], 16)
@@ -415,24 +415,24 @@ def test_404(self) -> None:
415415
assert spyne_span.ec is None
416416

417417
# spyne
418-
assert "spyne" == spyne_span.n
418+
assert spyne_span.n == "spyne"
419419
assert (
420420
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
421421
)
422-
assert "/11111" == spyne_span.data["http"]["url"]
423-
assert "GET" == spyne_span.data["http"]["method"]
424-
assert 404 == spyne_span.data["http"]["status"]
422+
assert spyne_span.data["http"]["url"] == "/11111"
423+
assert spyne_span.data["http"]["method"] == "GET"
424+
assert spyne_span.data["http"]["status"] == 404
425425
assert spyne_span.data["http"]["error"] is None
426426
assert spyne_span.stack is None
427427

428428
# urllib3
429-
assert "test" == test_span.data["sdk"]["name"]
430-
assert "urllib3" == urllib3_span.n
431-
assert 404 == urllib3_span.data["http"]["status"]
429+
assert test_span.data["sdk"]["name"] == "test"
430+
assert urllib3_span.n == "urllib3"
431+
assert urllib3_span.data["http"]["status"] == 404
432432
assert (
433433
testenv["spyne_server"] + "/11111" == urllib3_span.data["http"]["url"]
434434
)
435-
assert "GET" == urllib3_span.data["http"]["method"]
435+
assert urllib3_span.data["http"]["method"] == "GET"
436436
assert urllib3_span.stack is not None
437437
assert type(urllib3_span.stack) is list
438438
assert len(urllib3_span.stack) > 1
@@ -452,7 +452,7 @@ def test_500(self) -> None:
452452
test_span = spans[3]
453453

454454
assert response
455-
assert 500 == response.status
455+
assert response.status == 500
456456

457457
assert "X-INSTANA-T" in response.headers
458458
assert int(response.headers["X-INSTANA-T"], 16)
@@ -487,12 +487,12 @@ def test_500(self) -> None:
487487
assert spyne_span.ec == 1
488488

489489
# spyne
490-
assert "spyne" == spyne_span.n
490+
assert spyne_span.n == "spyne"
491491
assert (
492492
"127.0.0.1:" + str(testenv["spyne_port"]) == spyne_span.data["http"]["host"]
493493
)
494-
assert "/exception" == spyne_span.data["http"]["url"]
495-
assert "GET" == spyne_span.data["http"]["method"]
496-
assert 500 == spyne_span.data["http"]["status"]
494+
assert spyne_span.data["http"]["url"] == "/exception"
495+
assert spyne_span.data["http"]["method"] == "GET"
496+
assert spyne_span.data["http"]["status"] == 500
497497
assert spyne_span.data["http"]["error"] is None
498498
assert spyne_span.stack is None

tests/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ responses<=0.17.0
3434
sanic<=24.6.0; python_version < "3.9"
3535
sanic>=19.9.0; python_version >= "3.9" and python_version < "3.13"
3636
sanic-testing>=24.6.0; python_version < "3.13"
37-
starlette>=0.38.2; python_version == "3.13"
37+
spyne>=2.14.0; python_version < "3.12"
3838
sqlalchemy>=2.0.0
39+
starlette>=0.38.2; python_version == "3.13"
3940
tornado>=6.4.1
4041
uvicorn>=0.13.4
4142
urllib3>=1.26.5

0 commit comments

Comments
 (0)