Skip to content

Commit a8ccf1c

Browse files
authored
Update pytest to 8.4.0 (home-assistant#146114)
1 parent e3f7e57 commit a8ccf1c

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ asyncio_mode = "auto"
492492
asyncio_default_fixture_loop_scope = "function"
493493
filterwarnings = [
494494
"error::sqlalchemy.exc.SAWarning",
495+
"error:usefixtures\\(\\) in .* without arguments has no effect:UserWarning", # pytest
495496

496497
# -- HomeAssistant - aiohttp
497498
# Overwrite web.Application to pass a custom default argument to _make_request

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pytest-timeout==2.4.0
3030
pytest-unordered==0.6.1
3131
pytest-picked==0.5.1
3232
pytest-xdist==3.7.0
33-
pytest==8.3.5
33+
pytest==8.4.0
3434
requests-mock==1.12.1
3535
respx==0.22.0
3636
syrupy==4.9.1

tests/components/backup/test_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,15 +1866,15 @@ async def _mock_step(hass: HomeAssistant) -> None:
18661866
BackupManagerExceptionGroup,
18671867
(
18681868
"Multiple errors when creating backup: Error during pre-backup: Boom, "
1869-
"Error during post-backup: Test exception (2 sub-exceptions)"
1869+
"Error during post-backup: Test exception"
18701870
),
18711871
),
18721872
(
18731873
Exception("Boom"),
18741874
BackupManagerExceptionGroup,
18751875
(
18761876
"Multiple errors when creating backup: Error during pre-backup: Boom, "
1877-
"Error during post-backup: Test exception (2 sub-exceptions)"
1877+
"Error during post-backup: Test exception"
18781878
),
18791879
),
18801880
],

tests/components/workday/test_config_flow.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828

2929
from . import init_integration
3030

31-
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
32-
3331

32+
@pytest.mark.usefixtures("mock_setup_entry")
3433
async def test_form(hass: HomeAssistant) -> None:
3534
"""Test we get the forms."""
3635

@@ -74,6 +73,7 @@ async def test_form(hass: HomeAssistant) -> None:
7473
}
7574

7675

76+
@pytest.mark.usefixtures("mock_setup_entry")
7777
async def test_form_province_no_alias(hass: HomeAssistant) -> None:
7878
"""Test we get the forms."""
7979

@@ -115,6 +115,7 @@ async def test_form_province_no_alias(hass: HomeAssistant) -> None:
115115
}
116116

117117

118+
@pytest.mark.usefixtures("mock_setup_entry")
118119
async def test_form_no_country(hass: HomeAssistant) -> None:
119120
"""Test we get the forms correctly without a country."""
120121

@@ -154,6 +155,7 @@ async def test_form_no_country(hass: HomeAssistant) -> None:
154155
}
155156

156157

158+
@pytest.mark.usefixtures("mock_setup_entry")
157159
async def test_form_no_subdivision(hass: HomeAssistant) -> None:
158160
"""Test we get the forms correctly without subdivision."""
159161

@@ -196,6 +198,7 @@ async def test_form_no_subdivision(hass: HomeAssistant) -> None:
196198
}
197199

198200

201+
@pytest.mark.usefixtures("mock_setup_entry")
199202
async def test_options_form(hass: HomeAssistant) -> None:
200203
"""Test we get the form in options."""
201204

@@ -242,6 +245,7 @@ async def test_options_form(hass: HomeAssistant) -> None:
242245
}
243246

244247

248+
@pytest.mark.usefixtures("mock_setup_entry")
245249
async def test_form_incorrect_dates(hass: HomeAssistant) -> None:
246250
"""Test errors in setup entry."""
247251

@@ -314,6 +318,7 @@ async def test_form_incorrect_dates(hass: HomeAssistant) -> None:
314318
}
315319

316320

321+
@pytest.mark.usefixtures("mock_setup_entry")
317322
async def test_options_form_incorrect_dates(hass: HomeAssistant) -> None:
318323
"""Test errors in options."""
319324

@@ -390,6 +395,7 @@ async def test_options_form_incorrect_dates(hass: HomeAssistant) -> None:
390395
}
391396

392397

398+
@pytest.mark.usefixtures("mock_setup_entry")
393399
async def test_options_form_abort_duplicate(hass: HomeAssistant) -> None:
394400
"""Test errors in options for duplicates."""
395401

@@ -443,6 +449,7 @@ async def test_options_form_abort_duplicate(hass: HomeAssistant) -> None:
443449
assert result2["errors"] == {"base": "already_configured"}
444450

445451

452+
@pytest.mark.usefixtures("mock_setup_entry")
446453
async def test_form_incorrect_date_range(hass: HomeAssistant) -> None:
447454
"""Test errors in setup entry."""
448455

@@ -515,6 +522,7 @@ async def test_form_incorrect_date_range(hass: HomeAssistant) -> None:
515522
}
516523

517524

525+
@pytest.mark.usefixtures("mock_setup_entry")
518526
async def test_options_form_incorrect_date_ranges(hass: HomeAssistant) -> None:
519527
"""Test errors in options."""
520528

@@ -591,9 +599,6 @@ async def test_options_form_incorrect_date_ranges(hass: HomeAssistant) -> None:
591599
}
592600

593601

594-
pytestmark = pytest.mark.usefixtures()
595-
596-
597602
@pytest.mark.parametrize(
598603
("language", "holiday"),
599604
[

tests/test_test_fixtures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pathlib
66
import socket
77

8+
from _pytest.compat import get_real_func
89
from aiohttp import web
910
import pytest
1011
import pytest_socket
@@ -100,7 +101,7 @@ async def test_evict_faked_translations(hass: HomeAssistant, translations_once)
100101

101102
# The evict_faked_translations fixture has module scope, so we set it up and
102103
# tear it down manually
103-
real_func = evict_faked_translations.__pytest_wrapped__.obj
104+
real_func = get_real_func(evict_faked_translations)
104105
gen: Generator = real_func(translations_once)
105106

106107
# Set up the evict_faked_translations fixture

0 commit comments

Comments
 (0)