
API: - write main test body into tests/isolated/filename.py - it must write 'pass' to stdout or 'skip:[optional reason]' - write a test with single line: tests.run_isolated('filename.py') FIXME: autorun all files in tests/isolated This deprecates tests.run_python and ProcessBase. TODO: rewrite old multiline string test bodies to isolated files TODO: add timeout to p.communicate() in run_python()
31 lines
556 B
Python
31 lines
556 B
Python
from __future__ import print_function
|
|
|
|
import sys
|
|
|
|
import eventlet
|
|
|
|
|
|
# no standard tests in this file, ignore
|
|
__test__ = False
|
|
|
|
|
|
def do_import():
|
|
import encodings.idna
|
|
|
|
|
|
if __name__ == '__main__':
|
|
eventlet.monkey_patch()
|
|
threading = eventlet.patcher.original('threading')
|
|
|
|
sys.modules.pop('encodings.idna', None)
|
|
|
|
# call "import encodings.idna" in a new thread
|
|
thread = threading.Thread(target=do_import)
|
|
thread.start()
|
|
|
|
# call "import encodings.idna" in the main thread
|
|
do_import()
|
|
|
|
thread.join()
|
|
print('pass')
|