[pypy-commit] pypy default: Fix this test to also pass on CPython
arigo
noreply at buildbot.pypy.org
Tue Jun 11 13:26:16 CEST 2013
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r64849:93a61b856da8
Date: 2013-06-11 13:24 +0200
http://bitbucket.org/pypy/pypy/changeset/93a61b856da8/
Log: Fix this test to also pass on CPython
diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -566,20 +566,19 @@
assert 'setdefaultencoding' in dir(sys)
def test_reimport_builtin(self):
- # ...but not reload()!
- import sys
+ import sys, time
oldpath = sys.path
- sys.setdefaultencoding = "<test_reimport_builtin removed this>"
+ time.tzset = "<test_reimport_builtin removed this>"
- del sys.modules['sys']
- import sys as sys1
- assert sys.modules['sys'] is sys1 is sys
+ del sys.modules['time']
+ import time as time1
+ assert sys.modules['time'] is time1
- assert sys.path is oldpath
- assert sys.setdefaultencoding == "<test_reimport_builtin removed this>"
+ assert time.tzset == "<test_reimport_builtin removed this>"
- reload(sys) # fix it for people that want 'setdefaultencoding'
- assert sys.setdefaultencoding != "<test_reimport_builtin removed this>"
+ reload(time1) # don't leave a broken time.tzset behind
+ import time
+ assert time.tzset != "<test_reimport_builtin removed this>"
def test_reload_infinite(self):
import infinite_reload
More information about the pypy-commit
mailing list