diff options
author | Harro van der Klauw <hvdklauw@gmail.com> | 2015-03-23 15:29:26 +0100 |
---|---|---|
committer | Harro van der Klauw <hvdklauw@gmail.com> | 2015-03-23 15:29:26 +0100 |
commit | b7e2b731843347877045a95b85750272071f48da (patch) | |
tree | 038e73be898980cd5bc3470c5c686ebd7031ef51 /tests/test_timeout_decorator.py | |
parent | 94c8c1817bab02f5ca9b2b16329b5873d4594827 (diff) | |
download | timeout-decorator-b7e2b731843347877045a95b85750272071f48da.tar.gz |
Fixed issue with PicklingError causes the timeout to never be reached.
Diffstat (limited to 'tests/test_timeout_decorator.py')
-rw-r--r-- | tests/test_timeout_decorator.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_timeout_decorator.py b/tests/test_timeout_decorator.py index 12d5389..e8e9fbf 100644 --- a/tests/test_timeout_decorator.py +++ b/tests/test_timeout_decorator.py @@ -48,3 +48,15 @@ def test_function_name(use_signals): pass assert func_name.__name__ == 'func_name' + + +def test_timeout_pickle_error(): + """Test that when a pickle error occurs a timeout error is raised.""" + @timeout(seconds=1, use_signals=False) + def f(): + time.sleep(0.1) + class Test(object): + pass + return Test() + with pytest.raises(TimeoutError): + f() |