Intelligent timeout handler for setup/bootstrap (#38329)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
authored and GitHub committed 2020-08-05 14:58:19 +02:00
1 parent caca762088
commit c291d4aa7d
21 files changed
+901 -89

No files matched your search

-21
View File
@@ -1,15 +1,12 @@
"""Test requirements module."""
import os
from pathlib import Path
import pytest
from homeassistant import loader, setup
from homeassistant.requirements import (
CONSTRAINT_FILE,
PROGRESS_FILE,
RequirementsNotFound,
_install,
async_get_integration_with_requirements,
async_process_requirements,
)
@@ -190,24 +187,6 @@ async def test_install_on_docker(hass):
)
async def test_progress_lock(hass):
"""Test an install attempt on an existing package."""
progress_path = Path(hass.config.path(PROGRESS_FILE))
kwargs = {"hello": "world"}
def assert_env(req, **passed_kwargs):
"""Assert the env."""
assert progress_path.exists()
assert req == "hello"
assert passed_kwargs == kwargs
return True
with patch("homeassistant.util.package.install_package", side_effect=assert_env):
_install(hass, "hello", kwargs)
assert not progress_path.exists()
async def test_discovery_requirements_ssdp(hass):
"""Test that we load discovery requirements."""
hass.config.skip_pip = False