mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Bump pytest to 7.0.0 (#65981)
This commit is contained in:
parent
a03d8179d0
commit
8b38fa58aa
@ -25,7 +25,7 @@ pytest-test-groups==1.0.3
|
||||
pytest-sugar==0.9.4
|
||||
pytest-timeout==2.1.0
|
||||
pytest-xdist==2.4.0
|
||||
pytest==6.2.5
|
||||
pytest==7.0.0
|
||||
requests_mock==1.9.2
|
||||
respx==0.19.0
|
||||
stdlib-list==0.7.0
|
||||
|
@ -39,8 +39,11 @@ def setup_comp(hass):
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def teardown():
|
||||
"""Restore."""
|
||||
yield
|
||||
|
||||
dt_util.set_default_time_zone(ORIG_TIME_ZONE)
|
||||
|
||||
|
||||
|
@ -46,8 +46,11 @@ def setup_comp(hass):
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def teardown():
|
||||
"""Restore."""
|
||||
yield
|
||||
|
||||
dt_util.set_default_time_zone(ORIG_TIME_ZONE)
|
||||
|
||||
|
||||
|
@ -46,8 +46,11 @@ from tests.common import async_fire_time_changed
|
||||
DEFAULT_TIME_ZONE = dt_util.DEFAULT_TIME_ZONE
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def teardown():
|
||||
"""Stop everything that was started."""
|
||||
yield
|
||||
|
||||
dt_util.set_default_time_zone(DEFAULT_TIME_ZONE)
|
||||
|
||||
|
||||
|
@ -53,8 +53,11 @@ def create_file(path):
|
||||
pass
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def teardown():
|
||||
"""Clean up."""
|
||||
yield
|
||||
|
||||
dt_util.DEFAULT_TIME_ZONE = ORIG_TIMEZONE
|
||||
|
||||
if os.path.isfile(YAML_PATH):
|
||||
@ -78,6 +81,11 @@ def teardown():
|
||||
|
||||
async def test_create_default_config(hass):
|
||||
"""Test creation of default config."""
|
||||
assert not os.path.isfile(YAML_PATH)
|
||||
assert not os.path.isfile(SECRET_PATH)
|
||||
assert not os.path.isfile(VERSION_PATH)
|
||||
assert not os.path.isfile(AUTOMATIONS_PATH)
|
||||
|
||||
await config_util.async_create_default_config(hass)
|
||||
|
||||
assert os.path.isfile(YAML_PATH)
|
||||
@ -91,6 +99,7 @@ async def test_ensure_config_exists_creates_config(hass):
|
||||
|
||||
If not creates a new config file.
|
||||
"""
|
||||
assert not os.path.isfile(YAML_PATH)
|
||||
with patch("builtins.print") as mock_print:
|
||||
await config_util.async_ensure_config_exists(hass)
|
||||
|
||||
|
@ -9,8 +9,11 @@ DEFAULT_TIME_ZONE = dt_util.DEFAULT_TIME_ZONE
|
||||
TEST_TIME_ZONE = "America/Los_Angeles"
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def teardown():
|
||||
"""Stop everything that was started."""
|
||||
yield
|
||||
|
||||
dt_util.set_default_time_zone(DEFAULT_TIME_ZONE)
|
||||
|
||||
|
||||
|
@ -26,14 +26,14 @@ TEST_BAD_SERIALIED = "THIS IS NOT JSON\n"
|
||||
TMP_DIR = None
|
||||
|
||||
|
||||
def setup():
|
||||
"""Set up for tests."""
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_and_teardown():
|
||||
"""Clean up after tests."""
|
||||
global TMP_DIR
|
||||
TMP_DIR = mkdtemp()
|
||||
|
||||
yield
|
||||
|
||||
def teardown():
|
||||
"""Clean up after tests."""
|
||||
for fname in os.listdir(TMP_DIR):
|
||||
os.remove(os.path.join(TMP_DIR, fname))
|
||||
os.rmdir(TMP_DIR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user