diff --git a/supvisors/tests/base.py b/supvisors/tests/base.py index 571f7b9c..1fe4215e 100644 --- a/supvisors/tests/base.py +++ b/supvisors/tests/base.py @@ -19,6 +19,7 @@ import os import random +import supvisors from socket import gethostname from unittest.mock import Mock @@ -190,9 +191,8 @@ class DummyHttpContext: """ Simple HTTP context for web ui views. """ def __init__(self, template=None): - import supvisors - module_path = os.path.dirname(supvisors.__file__) - self.template = os.path.join(module_path, template) if template else None + supvisors_path = next(iter(supvisors.__path__), '.') + self.template = os.path.join(supvisors_path, template) if template else None self.supervisord = DummySupervisor() # create form and response self.form = {'SERVER_URL': 'http://10.0.0.1:7777',