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:
Pascal Vizeli
2020-07-13 22:26:41 +02:00
committed by GitHub
parent 7f4284f2af
commit bdfcf1a2df
13 changed files with 38 additions and 43 deletions

View File

@@ -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