Compare commits
2 Commits
dce8c995f6
...
0819d23f47
Author | SHA1 | Date |
---|---|---|
Sebastian Pipping | 0819d23f47 | |
Sebastian Pipping | a7d273f13f |
1
setup.py
1
setup.py
|
@ -14,6 +14,7 @@ setup(
|
||||||
author_email='seba@someserver.de',
|
author_email='seba@someserver.de',
|
||||||
install_requires=['pyopenssl'],
|
install_requires=['pyopenssl'],
|
||||||
tests_require=[
|
tests_require=[
|
||||||
|
'pathlib2; python_version<"3"',
|
||||||
'pytest',
|
'pytest',
|
||||||
'requests',
|
'requests',
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,16 +4,19 @@ import pytest
|
||||||
import requests
|
import requests
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import time
|
import time
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
# crudly written to learn more about pytest and to have a base for refactoring
|
# crudly written to learn more about pytest and to have a base for refactoring
|
||||||
|
|
||||||
try:
|
|
||||||
ConnectionRefusedError
|
if sys.version_info.major >= 3:
|
||||||
|
from pathlib import Path
|
||||||
connrefused_exc = ConnectionRefusedError
|
connrefused_exc = ConnectionRefusedError
|
||||||
except NameError:
|
else:
|
||||||
|
from pathlib2 import Path
|
||||||
connrefused_exc = socket.error
|
connrefused_exc = socket.error
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +28,8 @@ def run_servefile():
|
||||||
if not isinstance(args, list):
|
if not isinstance(args, list):
|
||||||
args = [args]
|
args = [args]
|
||||||
print("running with 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))
|
time.sleep(kwargs.get('timeout', 0.3))
|
||||||
instances.append(p)
|
instances.append(p)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue