aboutsummaryrefslogtreecommitdiff
path: root/tests/test_timeout_decorator.py
diff options
context:
space:
mode:
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():