Commit e8f73096 authored by Jason Madden's avatar Jason Madden

Tweak test for random ImportWarning from Python 3: ImportWarning: can't...

Tweak test for random ImportWarning from Python 3: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
parent a444b9a4
import sys
from _six import xrange
if 'runtestcase' in sys.argv[1:]:
import gevent
import gevent.subprocess
gevent.spawn(sys.exit, 'bye')
gevent.subprocess.Popen('python -c "1/0"'.split())
# Look closely, this doesn't actually do anything, that's a string
# not a division
gevent.subprocess.Popen([sys.executable, '-c', '"1/0"'])
gevent.sleep(1)
else:
import subprocess
for _ in xrange(5):
out, err = subprocess.Popen([sys.executable, __file__, 'runtestcase'], stderr=subprocess.PIPE).communicate()
if b'refs' in err:
for _ in range(5):
out, err = subprocess.Popen([sys.executable, '-W', 'ignore',
__file__, 'runtestcase'],
stderr=subprocess.PIPE).communicate()
if b'refs' in err: # Something to do with debug mode python builds?
assert err.startswith(b'bye'), repr(err)
else:
assert err.strip() == b'bye', repr(err)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment