Skip to content

Commit 0d8f838

Browse files
committed
tests: remove redundant asyncio markers
1 parent 4cd552d commit 0d8f838

File tree

10 files changed

+4
-75
lines changed

10 files changed

+4
-75
lines changed

backend/tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Shared fixtures for backend tests."""
22

3-
import hashlib
43
import secrets
54
from datetime import datetime, timedelta
65

backend/tests/test_auth.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"""Tests for token authentication."""
22

3-
import pytest
43

54

6-
@pytest.mark.asyncio
75
async def test_valid_bearer_token(client, auth_headers, sample_binary, sample_environment):
86
"""A valid Bearer token should authenticate successfully on a protected endpoint."""
97
payload = {
@@ -24,7 +22,6 @@ async def test_valid_bearer_token(client, auth_headers, sample_binary, sample_en
2422
assert response.status_code == 200
2523

2624

27-
@pytest.mark.asyncio
2825
async def test_upload_with_invalid_token(client, sample_binary, sample_environment):
2926
"""An invalid token should be rejected."""
3027
headers = {"Authorization": "Bearer invalid_token_value"}
@@ -36,7 +33,6 @@ async def test_upload_with_invalid_token(client, sample_binary, sample_environme
3633
assert response.status_code in (401, 403)
3734

3835

39-
@pytest.mark.asyncio
4036
async def test_upload_with_no_token(client):
4137
"""Missing token should be rejected."""
4238
response = await client.post(
@@ -46,7 +42,6 @@ async def test_upload_with_no_token(client):
4642
assert response.status_code in (401, 403)
4743

4844

49-
@pytest.mark.asyncio
5045
async def test_token_format_bearer(client, auth_token, sample_binary, sample_environment):
5146
"""'Bearer <token>' format should work."""
5247
raw_token, _ = auth_token
@@ -66,7 +61,6 @@ async def test_token_format_bearer(client, auth_token, sample_binary, sample_env
6661
assert response.status_code == 200
6762

6863

69-
@pytest.mark.asyncio
7064
async def test_token_format_token_prefix(client, auth_token, sample_binary, sample_environment):
7165
"""'Token <token>' format should also work."""
7266
raw_token, _ = auth_token
@@ -85,7 +79,6 @@ async def test_token_format_token_prefix(client, auth_token, sample_binary, samp
8579
assert response.status_code == 200
8680

8781

88-
@pytest.mark.asyncio
8982
async def test_inactive_token_rejected(client, db_session, auth_token, sample_binary, sample_environment):
9083
"""A deactivated token should be rejected."""
9184
raw_token, token_model = auth_token

backend/tests/test_benchmarks.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
"""Tests for the benchmarks API endpoints."""
22

3-
import pytest
43

54

6-
@pytest.mark.asyncio
75
async def test_all_benchmark_names_empty(client):
86
response = await client.get("/api/benchmarks")
97
assert response.status_code == 200
108
assert response.json() == []
119

1210

13-
@pytest.mark.asyncio
1411
async def test_all_benchmark_names(client, sample_benchmark_result):
1512
response = await client.get("/api/benchmarks")
1613
assert response.status_code == 200
1714
data = response.json()
1815
assert "json_dumps" in data
1916

2017

21-
@pytest.mark.asyncio
2218
async def test_filtered_benchmark_names(client, sample_benchmark_result):
2319
response = await client.get(
2420
"/api/benchmark-names",
@@ -34,7 +30,6 @@ async def test_filtered_benchmark_names(client, sample_benchmark_result):
3430
assert "json_dumps" in data
3531

3632

37-
@pytest.mark.asyncio
3833
async def test_filtered_benchmark_names_no_match(client, sample_benchmark_result):
3934
response = await client.get(
4035
"/api/benchmark-names",
@@ -49,7 +44,6 @@ async def test_filtered_benchmark_names_no_match(client, sample_benchmark_result
4944
assert response.json() == []
5045

5146

52-
@pytest.mark.asyncio
5347
async def test_diff_table(client, sample_benchmark_result):
5448
response = await client.get(
5549
"/api/diff",
@@ -69,7 +63,6 @@ async def test_diff_table(client, sample_benchmark_result):
6963
assert row["has_flamegraph"] is True
7064

7165

72-
@pytest.mark.asyncio
7366
async def test_diff_table_commit_not_found(client):
7467
response = await client.get(
7568
"/api/diff",
@@ -82,7 +75,6 @@ async def test_diff_table_commit_not_found(client):
8275
assert response.status_code == 404
8376

8477

85-
@pytest.mark.asyncio
8678
async def test_trends(client, sample_benchmark_result):
8779
response = await client.get(
8880
"/api/trends",
@@ -101,7 +93,6 @@ async def test_trends(client, sample_benchmark_result):
10193
assert data[0]["high_watermark_bytes"] == 1_000_000
10294

10395

104-
@pytest.mark.asyncio
10596
async def test_trends_batch(client, sample_benchmark_result):
10697
response = await client.post(
10798
"/api/trends-batch",
@@ -124,7 +115,6 @@ async def test_trends_batch(client, sample_benchmark_result):
124115
assert len(data["results"]) == 1
125116

126117

127-
@pytest.mark.asyncio
128118
async def test_flamegraph(client, sample_benchmark_result):
129119
result_id = sample_benchmark_result.id
130120
response = await client.get(f"/api/flamegraph/{result_id}")
@@ -134,7 +124,6 @@ async def test_flamegraph(client, sample_benchmark_result):
134124
assert data["benchmark_name"] == "json_dumps"
135125

136126

137-
@pytest.mark.asyncio
138127
async def test_flamegraph_not_found(client):
139128
response = await client.get("/api/flamegraph/nonexistent")
140129
assert response.status_code == 404

backend/tests/test_binaries.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
"""Tests for the binaries API endpoints."""
22

3-
import pytest
43

54

6-
@pytest.mark.asyncio
75
async def test_list_binaries_empty(client):
86
response = await client.get("/api/binaries")
97
assert response.status_code == 200
108
assert response.json() == []
119

1210

13-
@pytest.mark.asyncio
1411
async def test_list_binaries(client, sample_binary):
1512
response = await client.get("/api/binaries")
1613
assert response.status_code == 200
@@ -21,7 +18,6 @@ async def test_list_binaries(client, sample_binary):
2118
assert "--enable-optimizations" in data[0]["flags"]
2219

2320

24-
@pytest.mark.asyncio
2521
async def test_get_binary_by_id(client, sample_binary):
2622
response = await client.get("/api/binaries/default")
2723
assert response.status_code == 200
@@ -30,13 +26,11 @@ async def test_get_binary_by_id(client, sample_binary):
3026
assert data["description"] == "Standard build"
3127

3228

33-
@pytest.mark.asyncio
3429
async def test_get_binary_not_found(client):
3530
response = await client.get("/api/binaries/nonexistent")
3631
assert response.status_code == 404
3732

3833

39-
@pytest.mark.asyncio
4034
async def test_environments_for_binary(client, sample_benchmark_result):
4135
response = await client.get("/api/binaries/default/environments")
4236
assert response.status_code == 200
@@ -46,13 +40,11 @@ async def test_environments_for_binary(client, sample_benchmark_result):
4640
assert data[0]["run_count"] >= 1
4741

4842

49-
@pytest.mark.asyncio
5043
async def test_environments_for_nonexistent_binary(client):
5144
response = await client.get("/api/binaries/nonexistent/environments")
5245
assert response.status_code == 404
5346

5447

55-
@pytest.mark.asyncio
5648
async def test_commits_for_binary_and_environment(client, sample_benchmark_result):
5749
response = await client.get(
5850
"/api/binaries/default/environments/linux-x86_64/commits"

backend/tests/test_commits.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
"""Tests for the commits API endpoints."""
22

3-
import pytest
43

54

6-
@pytest.mark.asyncio
75
async def test_list_commits_empty(client):
86
response = await client.get("/api/commits")
97
assert response.status_code == 200
108
assert response.json() == []
119

1210

13-
@pytest.mark.asyncio
1411
async def test_list_commits(client, sample_commit):
1512
response = await client.get("/api/commits")
1613
assert response.status_code == 200
@@ -22,7 +19,6 @@ async def test_list_commits(client, sample_commit):
2219
assert data[0]["python_version"]["minor"] == 14
2320

2421

25-
@pytest.mark.asyncio
2622
async def test_list_commits_pagination(client, sample_commit):
2723
response = await client.get("/api/commits", params={"skip": 0, "limit": 1})
2824
assert response.status_code == 200
@@ -33,7 +29,6 @@ async def test_list_commits_pagination(client, sample_commit):
3329
assert len(response.json()) == 0
3430

3531

36-
@pytest.mark.asyncio
3732
async def test_get_commit_by_sha(client, sample_commit):
3833
response = await client.get(f"/api/commits/{sample_commit.sha}")
3934
assert response.status_code == 200
@@ -42,20 +37,17 @@ async def test_get_commit_by_sha(client, sample_commit):
4237
assert data["message"] == "Test commit"
4338

4439

45-
@pytest.mark.asyncio
4640
async def test_get_commit_not_found(client):
4741
response = await client.get("/api/commits/" + "f" * 40)
4842
assert response.status_code == 404
4943

5044

51-
@pytest.mark.asyncio
5245
async def test_python_versions_empty(client):
5346
response = await client.get("/api/python-versions")
5447
assert response.status_code == 200
5548
assert response.json() == []
5649

5750

58-
@pytest.mark.asyncio
5951
async def test_python_versions(client, sample_benchmark_result):
6052
response = await client.get("/api/python-versions")
6153
assert response.status_code == 200

backend/tests/test_environments.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
"""Tests for the environments API endpoints."""
22

3-
import pytest
43

54

6-
@pytest.mark.asyncio
75
async def test_list_environments_empty(client):
86
response = await client.get("/api/environments")
97
assert response.status_code == 200
108
assert response.json() == []
119

1210

13-
@pytest.mark.asyncio
1411
async def test_list_environments(client, sample_environment):
1512
response = await client.get("/api/environments")
1613
assert response.status_code == 200
@@ -20,15 +17,13 @@ async def test_list_environments(client, sample_environment):
2017
assert data[0]["name"] == "Linux x86_64"
2118

2219

23-
@pytest.mark.asyncio
2420
async def test_get_environment_by_id(client, sample_environment):
2521
response = await client.get("/api/environments/linux-x86_64")
2622
assert response.status_code == 200
2723
data = response.json()
2824
assert data["id"] == "linux-x86_64"
2925

3026

31-
@pytest.mark.asyncio
3227
async def test_get_environment_not_found(client):
3328
response = await client.get("/api/environments/nonexistent")
3429
assert response.status_code == 404

backend/tests/test_health.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"""Tests for the health check endpoint."""
22

3-
import pytest
43

54

6-
@pytest.mark.asyncio
75
async def test_health_check(client):
86
response = await client.get("/health")
97
assert response.status_code == 200
@@ -12,7 +10,6 @@ async def test_health_check(client):
1210
assert "timestamp" in data
1311

1412

15-
@pytest.mark.asyncio
1613
async def test_health_check_reports_db_status(client):
1714
"""The health router uses a module-level settings object with
1815
enable_health_check_db=True (not overridable via test_settings).

backend/tests/test_production_data.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ async def prod_data(db_session):
4646
await db_session.commit()
4747

4848

49-
@pytest.mark.asyncio
5049
async def test_diff_detects_regression(client, prod_data):
5150
"""The diff endpoint should show the deltablue_base regression."""
5251
response = await client.get(
@@ -74,7 +73,6 @@ async def test_diff_detects_regression(client, prod_data):
7473
assert nbody["metric_delta_percent"] == pytest.approx(0.0)
7574

7675

77-
@pytest.mark.asyncio
7876
async def test_diff_previous_commit_details(client, prod_data):
7977
"""The diff should include correct previous commit metadata."""
8078
response = await client.get(
@@ -99,7 +97,6 @@ async def test_diff_previous_commit_details(client, prod_data):
9997
assert curr["author"] == "alm"
10098

10199

102-
@pytest.mark.asyncio
103100
async def test_diff_first_commit_has_no_previous(client, prod_data):
104101
"""Diffing the earlier commit should show no previous data."""
105102
response = await client.get(
@@ -118,7 +115,6 @@ async def test_diff_first_commit_has_no_previous(client, prod_data):
118115
assert row["prev_commit_details"] is None
119116

120117

121-
@pytest.mark.asyncio
122118
async def test_diff_with_total_allocated_metric(client, prod_data):
123119
"""Diff should work with total_allocated_bytes metric too."""
124120
response = await client.get(
@@ -138,9 +134,8 @@ async def test_diff_with_total_allocated_metric(client, prod_data):
138134
assert deltablue["prev_metric_value"] == BENCH_DELTABLUE_PREV["total_allocated_bytes"]
139135

140136

141-
@pytest.mark.asyncio
142137
async def test_trends_returns_chronological_data(client, prod_data):
143-
"""Trends should return data points in chronological order."""
138+
"""Trends should return data points in reverse chronological order (newest first)."""
144139
response = await client.get(
145140
"/api/trends",
146141
params={
@@ -162,7 +157,6 @@ async def test_trends_returns_chronological_data(client, prod_data):
162157
assert data[1]["high_watermark_bytes"] == 1_557_777
163158

164159

165-
@pytest.mark.asyncio
166160
async def test_batch_trends_multiple_benchmarks(client, prod_data):
167161
"""Batch trends should return data for multiple benchmarks at once."""
168162
response = await client.post(
@@ -200,7 +194,6 @@ async def test_batch_trends_multiple_benchmarks(client, prod_data):
200194
assert len(results[json_key]) == 2
201195

202196

203-
@pytest.mark.asyncio
204197
async def test_benchmark_names_filtered_by_version(client, prod_data):
205198
"""Benchmark names should filter correctly by Python version."""
206199
response = await client.get(
@@ -229,7 +222,6 @@ async def test_benchmark_names_filtered_by_version(client, prod_data):
229222
assert response.json() == []
230223

231224

232-
@pytest.mark.asyncio
233225
async def test_python_versions_from_production_data(client, prod_data):
234226
response = await client.get("/api/python-versions")
235227
assert response.status_code == 200
@@ -239,7 +231,6 @@ async def test_python_versions_from_production_data(client, prod_data):
239231
assert versions[0]["minor"] == 15
240232

241233

242-
@pytest.mark.asyncio
243234
async def test_environments_for_binary(client, prod_data):
244235
response = await client.get("/api/binaries/nogil/environments")
245236
assert response.status_code == 200
@@ -250,7 +241,6 @@ async def test_environments_for_binary(client, prod_data):
250241
assert envs[0]["commit_count"] == 2
251242

252243

253-
@pytest.mark.asyncio
254244
async def test_commits_for_binary_and_environment(client, prod_data):
255245
response = await client.get(
256246
"/api/binaries/nogil/environments/gh_actions/commits"

0 commit comments

Comments
 (0)