Commit 1557a367 authored by Jason Madden's avatar Jason Madden

Fix test__execmodules to supply the right module name.

parent 5112e05f
......@@ -615,7 +615,8 @@ if local.__module__ == 'gevent.local':
else: # pragma: no cover
# Make sure we revisit in case of changes to the (accelerator) module names.
if local.__module__ != 'gevent._gevent_clocal':
raise AssertionError("Module names changed; revisit this code.")
raise AssertionError("Module names changed (local: %r; __name__: %r); revisit this code" % (
local.__module__, __name__) )
_init()
......
......@@ -8,14 +8,13 @@ from gevent.testing import six
def make_exec_test(path, module):
def test(_):
with open(path, 'rb') as f:
src = f.read()
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
try:
six.exec_(src, {'__file__': path})
six.exec_(src, {'__file__': path, '__name__': module})
except ImportError:
if module in modules.OPTIONAL_MODULES:
raise unittest.SkipTest("Unable to import optional module %s" % module)
......
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