aboutsummaryrefslogtreecommitdiff
path: root/tests/test_timeout_decorator.py
diff options
context:
space:
mode:
authorTaylor Alexander <tlalexander@gmail.com>2018-12-05 10:34:50 -0800
committerPatrick <pnpnpn@users.noreply.github.com>2018-12-05 13:34:50 -0500
commit3c4bad7f66e1109ccdcb79c2cb62cd669b7666d8 (patch)
tree2963c370414e905fc47634a80227163bc02948a3 /tests/test_timeout_decorator.py
parent3ad0308d30c4904b9ea272da326c0c3795161378 (diff)
downloadtimeout-decorator-3c4bad7f66e1109ccdcb79c2cb62cd669b7666d8.tar.gz
Fix a bug when using a custom exception with a custom exception message. Also remove tests for Python 3.2 and 3.3. (#55)
* Fix a bug in the code when using a custom exception with a custom exception message. Added a test for this condition. * Fix line spacing lint error. * Update CI config to remove Python 3.2 and 3.3, which are no longer supported by tox. * Remove python 3.2 and 3.3 from travis config. * Bump version number to 0.4.1. * Also update version number in init file to 0.4.1.
Diffstat (limited to 'tests/test_timeout_decorator.py')
-rw-r--r--tests/test_timeout_decorator.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_timeout_decorator.py b/tests/test_timeout_decorator.py
index 536bc8f..fad4d81 100644
--- a/tests/test_timeout_decorator.py
+++ b/tests/test_timeout_decorator.py
@@ -96,6 +96,14 @@ def test_timeout_custom_exception_message():
f()
+def test_timeout_custom_exception_with_message():
+ @timeout(seconds=1, timeout_exception=RuntimeError, exception_message="Custom fail message")
+ def f():
+ time.sleep(2)
+ with pytest.raises(RuntimeError, match="Custom fail message"):
+ f()
+
+
def test_timeout_default_exception_message():
@timeout(seconds=1)
def f():