From 7f9be17c92addb8e02d9b298c44402dd6d81a34f Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 21 Sep 2020 11:46:02 +0200 Subject: [PATCH] change pkg_resources for open __init__ in test too --- tests/test_endpoints.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 33abc009..a10989ac 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -123,7 +123,8 @@ def test_get_version(app: Devicehub, client: Client): """Checks GETting versions of services.""" content, res = client.get("/versions/", None) - dh_version = pkg_resources.require('ereuse-devicehub')[0].version + with open("ereuse_devicehub/__init__.py", encoding="utf8") as f: + dh_version = re.search(r'__version__ = "(.*?)"', f.read()).group(1) version = {'devicehub': dh_version, 'ereuse_tag': '0.0.0'} assert res.status_code == 200 assert content == version