Fix test_urllib2 error on Windows in relation with issue #13287.

This commit is contained in:
Florent Xicluna 2011-11-04 22:15:37 +01:00
parent 245a94b6e8
commit 3dbb1f17cb
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,10 @@ class TrivialTests(unittest.TestCase):
context = {}
exec('from urllib.%s import *' % module, context)
del context['__builtins__']
if module == 'request' and os.name == 'nt':
u, p = context.pop('url2pathname'), context.pop('pathname2url')
self.assertEqual(u.__module__, 'nturl2path')
self.assertEqual(p.__module__, 'nturl2path')
for k, v in context.items():
self.assertEqual(v.__module__, 'urllib.%s' % module,
"%r is exposed in 'urllib.%s' but defined in %r" %