summaryrefslogtreecommitdiff
path: root/test/test_execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-05-09 10:40:39 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-05-09 10:40:39 -0400
commitf77eb761dcfb51dacdc94ccd089a10b298e78c13 (patch)
treea6654261b9447ce42ea499a5d1edce769664996b /test/test_execfile.py
parentbd0921599e5c93271806fb7699f1e786c8dad6ac (diff)
downloadpython-coveragepy-f77eb761dcfb51dacdc94ccd089a10b298e78c13.tar.gz
Also make __builtins__ available in main programs.
Diffstat (limited to 'test/test_execfile.py')
-rw-r--r--test/test_execfile.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_execfile.py b/test/test_execfile.py
index fc5b52a..de1a575 100644
--- a/test/test_execfile.py
+++ b/test/test_execfile.py
@@ -33,12 +33,15 @@ class RunTest(CoverageTest):
# Argv should have the proper values.
self.assertEqual(mod_globs['argv'], [tryfile, "arg1", "arg2"])
+ # __builtins__ should have the right values, like open().
+ self.assertEqual(mod_globs['__builtins__.has_open'], True)
+
def test_no_extra_file(self):
# Make sure that running a file doesn't create an extra compiled file.
self.makeFile("xxx", """\
print "a non-.py file!"
""")
-
+
self.assertEqual(os.listdir("."), ["xxx"])
run_python_file("xxx", ["xxx"])
self.assertEqual(os.listdir("."), ["xxx"])