diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-04 08:34:23 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-04 08:34:23 -0400 |
commit | 3bf521fdf5cd8d4715d03f22d20d82012deb8ddc (patch) | |
tree | 80799bfd61cd9813556e463289a44693b297f063 /test/try_execfile.py | |
parent | 281e88d349332b4e9f06edd2a073baface6b56ce (diff) | |
download | python-coveragepy-git-3bf521fdf5cd8d4715d03f22d20d82012deb8ddc.tar.gz |
Even better execution of main files.
Diffstat (limited to 'test/try_execfile.py')
-rw-r--r-- | test/try_execfile.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/try_execfile.py b/test/try_execfile.py index 523823e4..f66b9c5b 100644 --- a/test/try_execfile.py +++ b/test/try_execfile.py @@ -1,5 +1,25 @@ +"""Test file for run_python_file.""" + +import pprint, sys + +DATA = "xyzzy" + +import __main__ + +def my_function(a): + return "my_fn(%r)" % a + +FN_VAL = my_function("fooey") + globals_to_check = { '__name__': __name__, '__file__': __file__, + '__doc__': __doc__, + 'DATA': DATA, + 'FN_VAL': FN_VAL, + '__main__.DATA': getattr(__main__, "DATA", "nothing"), + 'argv': sys.argv, + 'path0': sys.path[0], } -print repr(globals_to_check) + +pprint.pprint(globals_to_check) |