diff --git a/setup.py b/setup.py index 2c9fa09..309b4a8 100755 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ setup( author_email='seba@someserver.de', install_requires=['pyopenssl'], tests_require=[ + 'pathlib2; python_version<"3"', 'pytest', 'requests', ], diff --git a/tests/test_servefile.py b/tests/test_servefile.py index e6f3bd0..8132f6b 100644 --- a/tests/test_servefile.py +++ b/tests/test_servefile.py @@ -13,8 +13,10 @@ import urllib3 if sys.version_info.major >= 3: + from pathlib import Path connrefused_exc = ConnectionRefusedError else: + from pathlib2 import Path connrefused_exc = socket.error @@ -26,7 +28,8 @@ def run_servefile(): if not isinstance(args, list): args = [args] print("running with args", args) - p = subprocess.Popen(['servefile'] + args, **kwargs) + servefile_path = str(Path(__file__).parent.parent / 'servefile') + p = subprocess.Popen([sys.executable, servefile_path] + args, **kwargs) time.sleep(kwargs.get('timeout', 0.3)) instances.append(p) diff --git a/tox.ini b/tox.ini index 43383ed..e04928e 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ envlist = py27,py36 [testenv] deps = + pathlib2; python_version<"3" pytest requests commands = pytest --tb=short {posargs}