summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.txt2
-rw-r--r--coverage/cmdline.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/TODO.txt b/TODO.txt
index 0fde057a..7f418aa5 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -102,6 +102,7 @@ x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do
* Tests
+- Switch to a real test runner, like nose.
- Tests about the .coverage file.
- Tests about the --long-form of arguments.
- Tests about overriding the .coverage filename.
@@ -111,3 +112,4 @@ x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do
- Coverage test coverage.py!
- Tests that tracing stops after calling stop()
- More intensive thread testing.
+- Tests about the "import __main__" in cmdline.py
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 58eae714..0561f327 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -112,14 +112,18 @@ class CoverageScript:
if settings.get('erase'):
self.coverage.erase()
+
if settings.get('execute'):
if not args:
help_fn("Nothing to do.")
+ # Create the runtime environment the script on the cmdline expects.
sys.argv = args
- self.coverage.start()
- import __main__
sys.path[0] = os.path.dirname(sys.argv[0])
+ import __main__ # TODO: I think this is useless...
+ self.coverage.start()
execfile(sys.argv[0], __main__.__dict__)
+ self.coverage.stop()
+
if settings.get('combine'):
self.coverage.combine()