Author: Armin Rigo <ar...@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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit