Skip to content

Commit 0a92e49

Browse files
committed
fix: tests
1 parent 8bf9e35 commit 0a92e49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration/aiohttp/test_middlewares.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ async def test_metrics_with_tracing(aiohttp_client: AiohttpClient) -> None:
128128
"http.flavor": "1.1",
129129
"http.target": "/",
130130
"http.method": "GET",
131-
"http.user_agent": "Python/3.10 aiohttp/3.10.5",
132131
"net.peer.ip": "127.0.0.1",
133132
"http.route": "/",
134133
"http.status_code": 200,
@@ -167,6 +166,7 @@ async def test_metrics_with_tracing(aiohttp_client: AiohttpClient) -> None:
167166
assert attrs["http.url"].startswith("http://127.0.0.1:")
168167
assert attrs["http.server_name"].startswith("127.0.0.1:")
169168
assert isinstance(attrs["net.peer.port"], int)
169+
assert "Python" in attrs["http.user_agent"]
170170
assert response.status == 200
171171

172172
metrics = get_latest_metrics(metrics_cfg.registry, openmetrics_format=True)
@@ -356,7 +356,6 @@ async def test_tracing(aiohttp_client: AiohttpClient) -> None:
356356
"http.flavor": "1.1",
357357
"http.target": "/",
358358
"http.method": "GET",
359-
"http.user_agent": "Python/3.10 aiohttp/3.10.5",
360359
"net.peer.ip": "127.0.0.1",
361360
"http.route": "/",
362361
"http.status_code": 200,
@@ -385,6 +384,7 @@ async def test_tracing(aiohttp_client: AiohttpClient) -> None:
385384
assert attrs["http.url"].startswith("http://127.0.0.1:")
386385
assert attrs["http.server_name"].startswith("127.0.0.1:")
387386
assert isinstance(attrs["net.peer.port"], int)
387+
assert "Python" in attrs["http.user_agent"]
388388
assert response.status == 200
389389

390390

@@ -418,7 +418,6 @@ async def test_not_found_tracing(aiohttp_client: AiohttpClient) -> None:
418418
"http.flavor": "1.1",
419419
"http.target": "/",
420420
"http.method": "GET",
421-
"http.user_agent": "Python/3.10 aiohttp/3.10.5",
422421
"net.peer.ip": "127.0.0.1",
423422
"http.route": "/",
424423
"http.status_code": 404,
@@ -446,4 +445,5 @@ async def test_not_found_tracing(aiohttp_client: AiohttpClient) -> None:
446445
assert attrs["http.url"].startswith("http://127.0.0.1:")
447446
assert attrs["http.server_name"].startswith("127.0.0.1:")
448447
assert isinstance(attrs["net.peer.port"], int)
448+
assert "Python" in attrs["http.user_agent"]
449449
assert response.status == 404

0 commit comments

Comments
 (0)