diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/isolated/patched_threading_join.py | 23 | ||||
| -rw-r--r-- | tests/patcher_test.py | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/isolated/patched_threading_join.py b/tests/isolated/patched_threading_join.py new file mode 100644 index 0000000..4361f52 --- /dev/null +++ b/tests/isolated/patched_threading_join.py @@ -0,0 +1,23 @@ +# Issue #223: test threading.Thread.join with monkey-patching +import eventlet + +# no standard tests in this file, ignore +__test__ = False + + +if __name__ == '__main__': + eventlet.monkey_patch() + + import threading + import time + + sleeper = threading.Thread(target=time.sleep, args=(1,)) + start = time.time() + sleeper.start() + sleeper.join() + dt = time.time() - start + + if dt < 1.0: + raise Exception("test failed: dt=%s" % dt) + + print('pass') diff --git a/tests/patcher_test.py b/tests/patcher_test.py index 2a42e3c..b20ae70 100644 --- a/tests/patcher_test.py +++ b/tests/patcher_test.py @@ -502,3 +502,7 @@ def test_importlib_lock(): def test_threading_condition(): tests.run_isolated('patcher_threading_condition.py') + + +def test_threading_join(): + tests.run_isolated('patched_threading_join.py') |
