summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-08-06 22:28:09 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-08-06 22:28:09 (GMT)
commit3aa2a49ec97d8a56f7f748116d8cd584185c301d (patch)
tree0bbbae6149e106cf841060696175d5a7776f49aa /Lib/test
parentc777a412f1e8c691eb25074bf85c4e8ca854f038 (diff)
downloadcpython-3aa2a49ec97d8a56f7f748116d8cd584185c301d.zip
cpython-3aa2a49ec97d8a56f7f748116d8cd584185c301d.tar.gz
cpython-3aa2a49ec97d8a56f7f748116d8cd584185c301d.tar.bz2
Add imp.reload(). This to help with transitioning to 3.0 the reload() built-in
has been removed there.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_imp.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index f597728..513ca60 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -37,9 +37,28 @@ class LockTests(unittest.TestCase):
self.fail("release_lock() without lock should raise "
"RuntimeError")
+class ReloadTests(unittest.TestCase):
+
+ """Very basic tests to make sure that imp.reload() operates just like
+ reload()."""
+
+ def test_source(self):
+ import os
+ imp.reload(os)
+
+ def test_extension(self):
+ import time
+ imp.reload(time)
+
+ def test_builtin(self):
+ import marshal
+ imp.reload(marshal)
+
+
def test_main():
test_support.run_unittest(
LockTests,
+ ReloadTests,
)
if __name__ == "__main__":