From 986bed61d20774107dc27c6569f8d14529b774b6 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 27 Nov 2009 13:08:56 -0500 Subject: [PATCH] Patcherized test_threading_local --- tests/stdlib/test_threading_local.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/stdlib/test_threading_local.py b/tests/stdlib/test_threading_local.py index ada5d8e..04ab5db 100644 --- a/tests/stdlib/test_threading_local.py +++ b/tests/stdlib/test_threading_local.py @@ -1,17 +1,17 @@ +from eventlet import patcher from eventlet.green import thread from eventlet.green import threading from eventlet.green import time -from test import test_threading_local +# hub requires initialization before test can run +from eventlet import api +api.get_hub() -test_threading_local.threading = threading - -def test_main(): - import sys - sys.modules['thread'] = thread - sys.modules['threading'] = threading - sys.modules['time'] = time - test_threading_local.test_main() +patcher.inject('test.test_threading_local', + globals(), + ('time', time), + ('thread', thread), + ('threading', threading)) if __name__ == '__main__': test_main() \ No newline at end of file