Skip to content

Commit 63bc0a6

Browse files
committed
Remove redundant pytest.mark.asyncio
We use 'asyncio_mode = "auto"', so this mark is not necessary
1 parent a8fe9d2 commit 63bc0a6

3 files changed

Lines changed: 0 additions & 19 deletions

File tree

tests/program_notifications/test_program_connector.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ async def mock_schedule_url(mock_client):
4747
return str(mock_client.make_url("/schedule"))
4848

4949

50-
@pytest.mark.asyncio
5150
async def test_parse_schedule(program_connector, mock_schedule):
5251
sessions_by_day = await program_connector.parse_schedule(mock_schedule)
5352

@@ -58,7 +57,6 @@ async def test_parse_schedule(program_connector, mock_schedule):
5857
assert len(sessions_by_day[date(2024, 7, 12)]) == 3
5958

6059

61-
@pytest.mark.asyncio
6260
async def test_fetch_schedule(program_connector, mock_schedule_url, cache_file, mock_schedule):
6361
program_connector._api_url = mock_schedule_url
6462

@@ -69,7 +67,6 @@ async def test_fetch_schedule(program_connector, mock_schedule_url, cache_file,
6967
assert cached_data == mock_schedule
7068

7169

72-
@pytest.mark.asyncio
7370
async def test_get_schedule_from_cache(program_connector, mock_schedule, cache_file):
7471
async with aiofiles.open(cache_file, "w") as f:
7572
await f.write(json.dumps(mock_schedule))
@@ -82,7 +79,6 @@ async def test_get_schedule_from_cache(program_connector, mock_schedule, cache_f
8279
assert len(sessions_by_day[date(2024, 7, 12)]) == 3
8380

8481

85-
@pytest.mark.asyncio
8682
async def test_get_sessions_by_date(program_connector, mock_schedule_url):
8783
program_connector._api_url = mock_schedule_url
8884

@@ -117,7 +113,6 @@ async def test_get_sessions_by_date(program_connector, mock_schedule_url):
117113
assert len(sessions) == 0
118114

119115

120-
@pytest.mark.asyncio
121116
async def test_get_upcoming_sessions(program_connector, mock_schedule_url):
122117
program_connector._api_url = mock_schedule_url
123118

@@ -158,7 +153,6 @@ async def test_get_upcoming_sessions(program_connector, mock_schedule_url):
158153
assert len(upcoming_sessions) == 0
159154

160155

161-
@pytest.mark.asyncio
162156
async def test_fetch_schedule_error_handling(
163157
program_connector, unused_tcp_port_factory, aiohttp_client
164158
):
@@ -178,13 +172,11 @@ async def mock_api_handler(request): # noqa: ARG001 (unused argument)
178172
assert program_connector.sessions_by_day is None
179173

180174

181-
@pytest.mark.asyncio
182175
async def test_get_sessions_by_date_with_empty_schedule(program_connector):
183176
sessions = await program_connector.get_sessions_by_date(date(2024, 7, 10))
184177
assert len(sessions) == 0
185178

186179

187-
@pytest.mark.asyncio
188180
async def test_get_now_with_simulation(program_connector):
189181
simulated_start_time = datetime(2024, 7, 10, 8, 0, 0, tzinfo=UTC)
190182
program_connector._simulated_start_time = simulated_start_time
@@ -197,7 +189,6 @@ async def test_get_now_with_simulation(program_connector):
197189
assert await program_connector._get_now() > simulated_start_time
198190

199191

200-
@pytest.mark.asyncio
201192
async def test_get_now_without_simulation(program_connector):
202193
now = await program_connector._get_now()
203194

tests/registration/test_pretix_connector.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ async def pretix_mock(aiohttp_client, unused_tcp_port_factory) -> PretixMock:
8282
)
8383

8484

85-
@pytest.mark.asyncio
8685
async def test_pretix_items(pretix_mock):
8786
pretix_connector = PretixConnector(url=pretix_mock.base_url, token=PRETIX_API_TOKEN)
8887

@@ -99,7 +98,6 @@ async def test_pretix_items(pretix_mock):
9998
assert item_names_by_id[163253] == "Combined (Conference + Tutorials)"
10099

101100

102-
@pytest.mark.asyncio
103101
async def test_pretix_orders(pretix_mock):
104102
pretix_connector = PretixConnector(url=pretix_mock.base_url, token=PRETIX_API_TOKEN)
105103

@@ -298,7 +296,6 @@ async def test_pagination(aiohttp_client, unused_tcp_port_factory):
298296
)
299297

300298

301-
@pytest.mark.asyncio
302299
async def test_consecutive_fetches_are_prevented(pretix_mock):
303300
pretix_connector = PretixConnector(url=pretix_mock.base_url, token=PRETIX_API_TOKEN)
304301
requests = pretix_mock.requests
@@ -317,7 +314,6 @@ async def test_consecutive_fetches_are_prevented(pretix_mock):
317314
assert len(requests) == 0
318315

319316

320-
@pytest.mark.asyncio
321317
async def test_consecutive_fetches_after_some_time_fetch_updates(pretix_mock):
322318
pretix_connector = PretixConnector(url=pretix_mock.base_url, token=PRETIX_API_TOKEN)
323319
requests = pretix_mock.requests
@@ -344,7 +340,6 @@ async def test_consecutive_fetches_after_some_time_fetch_updates(pretix_mock):
344340
assert datetime.fromisoformat(requests[1].url.query["modified_since"]) == three_minutes_before
345341

346342

347-
@pytest.mark.asyncio
348343
async def test_api_error_responses_are_raised(aiohttp_client, unused_tcp_port_factory):
349344
pretix_mock = await create_pretix_app_mock(
350345
response_factories={
@@ -368,7 +363,6 @@ async def test_api_error_responses_are_raised(aiohttp_client, unused_tcp_port_fa
368363
assert e.value.status == HTTPStatus.INTERNAL_SERVER_ERROR
369364

370365

371-
@pytest.mark.asyncio
372366
async def test_multiple_tickets(aiohttp_client, unused_tcp_port_factory):
373367
pretix_mock = await create_pretix_app_mock(
374368
{

tests/registration/test_registration_logger.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def test_with_existing_file(tmp_path: Path) -> None:
2424
)
2525

2626

27-
@pytest.mark.asyncio
2827
async def test_register_ticket_on_empty_log(tmp_path: Path) -> None:
2928
logger = RegistrationLogger(tmp_path / "registrations.txt")
3029

@@ -36,7 +35,6 @@ async def test_register_ticket_on_empty_log(tmp_path: Path) -> None:
3635
assert (tmp_path / "registrations.txt").read_text() == "ABC01-johndoe\n"
3736

3837

39-
@pytest.mark.asyncio
4038
async def test_register_ticket_with_existing_file(tmp_path: Path) -> None:
4139
logger = RegistrationLogger(tmp_path / "registrations.txt")
4240

@@ -48,7 +46,6 @@ async def test_register_ticket_with_existing_file(tmp_path: Path) -> None:
4846
assert (tmp_path / "registrations.txt").read_text() == "ABC01-johndoe\n"
4947

5048

51-
@pytest.mark.asyncio
5249
async def test_register_ticket_with_existing_log(tmp_path: Path) -> None:
5350
(tmp_path / "registrations.txt").write_text("ABC01-johndoe\n")
5451

@@ -62,7 +59,6 @@ async def test_register_ticket_with_existing_log(tmp_path: Path) -> None:
6259
assert (tmp_path / "registrations.txt").read_text() == "ABC01-johndoe\nABC02-janedoe\n"
6360

6461

65-
@pytest.mark.asyncio
6662
async def test_register_already_registered_ticket(tmp_path: Path) -> None:
6763
logger = RegistrationLogger(tmp_path / "registrations.txt")
6864

0 commit comments

Comments
 (0)