diff options
author | Josh <joshdunn.uwo@gmail.com> | 2017-06-10 04:13:09 -0400 |
---|---|---|
committer | Josh <joshdunn.uwo@gmail.com> | 2017-06-10 04:13:09 -0400 |
commit | 0520e0092ffdaf5faf46f6b440e11ba620e9a934 (patch) | |
tree | 7492224d99d15198a97fa4a73b77164e1afb94a3 | |
parent | 2b9b47683c468074cd1038108423418ef8500ae9 (diff) | |
download | timeout-decorator-0520e0092ffdaf5faf46f6b440e11ba620e9a934.tar.gz |
Can set exception message in decorator.
-rw-r--r-- | tests/test_timeout_decorator.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_timeout_decorator.py b/tests/test_timeout_decorator.py index 52b0e97..536bc8f 100644 --- a/tests/test_timeout_decorator.py +++ b/tests/test_timeout_decorator.py @@ -89,12 +89,10 @@ def test_timeout_pickle_error(): def test_timeout_custom_exception_message(): - message = "Custom fail message" - - @timeout(seconds=1, exception_message=message) + @timeout(seconds=1, exception_message="Custom fail message") def f(): time.sleep(2) - with pytest.raises(TimeoutError, match=message): + with pytest.raises(TimeoutError, match="Custom fail message"): f() |