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.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_timeout_decorator.py b/tests/test_timeout_decorator.py
index d1a0efd..536bc8f 100644
--- a/tests/test_timeout_decorator.py
+++ b/tests/test_timeout_decorator.py
@@ -86,3 +86,19 @@ def test_timeout_pickle_error():
return Test()
with pytest.raises(TimeoutError):
f()
+
+
+def test_timeout_custom_exception_message():
+ @timeout(seconds=1, exception_message="Custom fail message")
+ def f():
+ time.sleep(2)
+ with pytest.raises(TimeoutError, match="Custom fail message"):
+ f()
+
+
+def test_timeout_default_exception_message():
+ @timeout(seconds=1)
+ def f():
+ time.sleep(2)
+ with pytest.raises(TimeoutError, match="Timed Out"):
+ f()