mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +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-sugar==0.9.4
|
||||||
pytest-timeout==2.1.0
|
pytest-timeout==2.1.0
|
||||||
pytest-xdist==2.4.0
|
pytest-xdist==2.4.0
|
||||||
pytest==6.2.5
|
pytest==7.0.0
|
||||||
requests_mock==1.9.2
|
requests_mock==1.9.2
|
||||||
respx==0.19.0
|
respx==0.19.0
|
||||||
stdlib-list==0.7.0
|
stdlib-list==0.7.0
|
||||||
|
@ -39,8 +39,11 @@ def setup_comp(hass):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
def teardown():
|
def teardown():
|
||||||
"""Restore."""
|
"""Restore."""
|
||||||
|
yield
|
||||||
|
|
||||||
dt_util.set_default_time_zone(ORIG_TIME_ZONE)
|
dt_util.set_default_time_zone(ORIG_TIME_ZONE)
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,8 +46,11 @@ def setup_comp(hass):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
def teardown():
|
def teardown():
|
||||||
"""Restore."""
|
"""Restore."""
|
||||||
|
yield
|
||||||
|
|
||||||
dt_util.set_default_time_zone(ORIG_TIME_ZONE)
|
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
|
DEFAULT_TIME_ZONE = dt_util.DEFAULT_TIME_ZONE
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
def teardown():
|
def teardown():
|
||||||
"""Stop everything that was started."""
|
"""Stop everything that was started."""
|
||||||
|
yield
|
||||||
|
|
||||||
dt_util.set_default_time_zone(DEFAULT_TIME_ZONE)
|
dt_util.set_default_time_zone(DEFAULT_TIME_ZONE)
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,8 +53,11 @@ def create_file(path):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
def teardown():
|
def teardown():
|
||||||
"""Clean up."""
|
"""Clean up."""
|
||||||
|
yield
|
||||||
|
|
||||||
dt_util.DEFAULT_TIME_ZONE = ORIG_TIMEZONE
|
dt_util.DEFAULT_TIME_ZONE = ORIG_TIMEZONE
|
||||||
|
|
||||||
if os.path.isfile(YAML_PATH):
|
if os.path.isfile(YAML_PATH):
|
||||||
@ -78,6 +81,11 @@ def teardown():
|
|||||||
|
|
||||||
async def test_create_default_config(hass):
|
async def test_create_default_config(hass):
|
||||||
"""Test creation of default config."""
|
"""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)
|
await config_util.async_create_default_config(hass)
|
||||||
|
|
||||||
assert os.path.isfile(YAML_PATH)
|
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.
|
If not creates a new config file.
|
||||||
"""
|
"""
|
||||||
|
assert not os.path.isfile(YAML_PATH)
|
||||||
with patch("builtins.print") as mock_print:
|
with patch("builtins.print") as mock_print:
|
||||||
await config_util.async_ensure_config_exists(hass)
|
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"
|
TEST_TIME_ZONE = "America/Los_Angeles"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
def teardown():
|
def teardown():
|
||||||
"""Stop everything that was started."""
|
"""Stop everything that was started."""
|
||||||
|
yield
|
||||||
|
|
||||||
dt_util.set_default_time_zone(DEFAULT_TIME_ZONE)
|
dt_util.set_default_time_zone(DEFAULT_TIME_ZONE)
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,14 +26,14 @@ TEST_BAD_SERIALIED = "THIS IS NOT JSON\n"
|
|||||||
TMP_DIR = None
|
TMP_DIR = None
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
@pytest.fixture(autouse=True)
|
||||||
"""Set up for tests."""
|
def setup_and_teardown():
|
||||||
|
"""Clean up after tests."""
|
||||||
global TMP_DIR
|
global TMP_DIR
|
||||||
TMP_DIR = mkdtemp()
|
TMP_DIR = mkdtemp()
|
||||||
|
|
||||||
|
yield
|
||||||
|
|
||||||
def teardown():
|
|
||||||
"""Clean up after tests."""
|
|
||||||
for fname in os.listdir(TMP_DIR):
|
for fname in os.listdir(TMP_DIR):
|
||||||
os.remove(os.path.join(TMP_DIR, fname))
|
os.remove(os.path.join(TMP_DIR, fname))
|
||||||
os.rmdir(TMP_DIR)
|
os.rmdir(TMP_DIR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user