mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-10 19:40:16 +00:00
Migrate to python 3.8 (#1824)
* Migrate to python 3.8 * Fix tests on Py38 * cleanup tests Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
@@ -7,20 +7,3 @@ def load_json_fixture(filename):
|
||||
"""Load a fixture."""
|
||||
path = Path(Path(__file__).parent.joinpath("fixtures"), filename)
|
||||
return json.loads(path.read_text())
|
||||
|
||||
|
||||
def mock_coro(return_value=None, exception=None):
|
||||
"""Return a coro that returns a value or raise an exception."""
|
||||
return mock_coro_func(return_value, exception)()
|
||||
|
||||
|
||||
def mock_coro_func(return_value=None, exception=None):
|
||||
"""Return a method to create a coro function that returns a value."""
|
||||
|
||||
async def coro(*args, **kwargs):
|
||||
"""Fake coroutine."""
|
||||
if exception:
|
||||
raise exception
|
||||
return return_value
|
||||
|
||||
return coro
|
||||
|
||||
Reference in New Issue
Block a user