Skip to content

Commit

Permalink
fix __file__ issue in python 3.8 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julien6387 committed Nov 20, 2021
1 parent 4d370a7 commit 0c666da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions supvisors/tests/base.py
Expand Up @@ -19,6 +19,7 @@

import os
import random
import supvisors

from socket import gethostname
from unittest.mock import Mock
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 0c666da

Please sign in to comment.