tests: activate faulthandler if available

issue260
David Wilson 6 years ago
parent efed9da474
commit 53d882dcbd

@ -5,6 +5,7 @@ mock==2.0.0
pytz==2018.5 pytz==2018.5
cffi==1.11.2 # Random pin to try and fix pyparser==2.18 not having effect cffi==1.11.2 # Random pin to try and fix pyparser==2.18 not having effect
pycparser==2.18 # Last version supporting 2.6. pycparser==2.18 # Last version supporting 2.6.
faulthandler==3.1; python_version < '3.3' # used by testlib
pytest-catchlog==1.2.2 pytest-catchlog==1.2.2
pytest==3.1.2 pytest==3.1.2
PyYAML==3.11; python_version < '2.7' PyYAML==3.11; python_version < '2.7'

@ -14,6 +14,11 @@ import mitogen.core
import mitogen.master import mitogen.master
import mitogen.utils import mitogen.utils
try:
import faulthandler
except ImportError:
pass
try: try:
import urlparse import urlparse
except ImportError: except ImportError:
@ -32,6 +37,9 @@ sys.path.append(DATA_DIR)
if mitogen.is_master: if mitogen.is_master:
mitogen.utils.log_to_file() mitogen.utils.log_to_file()
if faulthandler is not None:
faulthandler.enable()
def data_path(suffix): def data_path(suffix):
path = os.path.join(DATA_DIR, suffix) path = os.path.join(DATA_DIR, suffix)

Loading…
Cancel
Save