summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-requirements.txt1
-rw-r--r--pytest.ini7
-rw-r--r--tasks.py1
3 files changed, 9 insertions, 0 deletions
diff --git a/dev-requirements.txt b/dev-requirements.txt
index cc11c0fc..cff31e73 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -8,3 +8,4 @@ wheel==0.24
twine>=1.11.0
flake8==2.6.2
pytest==3.2.1
+pytest-timeout==1.2.0
diff --git a/pytest.ini b/pytest.ini
new file mode 100644
index 00000000..af021870
--- /dev/null
+++ b/pytest.ini
@@ -0,0 +1,7 @@
+[pytest]
+# 10 seconds is more time than nearly any test ought to take and almost surely
+# indicates a full-on deadlock; but let's make it 30s just to be sure.
+timeout = 30
+# Sadly the signal method of pytest-timeout does not appear to help, at least
+# for the SFTP hangs encountered developing issue #1100.
+timeout_method = thread
diff --git a/tasks.py b/tasks.py
index d232fa9b..a9c94ec3 100644
--- a/tasks.py
+++ b/tasks.py
@@ -27,6 +27,7 @@ def test(ctx, verbose=True, coverage=False, opts=""):
if 'SSH_AUTH_SOCK' in env:
del env['SSH_AUTH_SOCK']
cmd = "{} {}".format(runner, opts)
+ # NOTE: we have a pytest.ini and tend to use that over PYTEST_ADDOPTS.
ctx.run(cmd, pty=True, env=env, replace_env=True)