diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-07-09 10:50:23 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-07-09 10:50:23 -0400 |
commit | 99bcf82c44a431607b21b1a01cfd9b0dc88872c7 (patch) | |
tree | 60cb39b8e838abba8a8e8980895fe9bd3d2cb5f5 | |
parent | c8d85025b4bc4db8bec0636792434555c7a60cd5 (diff) | |
download | python-coveragepy-99bcf82c44a431607b21b1a01cfd9b0dc88872c7.tar.gz |
Have the tests use the script explicitly until I can figure out how to install a usable script for Py3k
-rw-r--r-- | coverage/backward.py | 8 | ||||
-rw-r--r-- | test/test_farm.py | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/coverage/backward.py b/coverage/backward.py index 91f07bf..7ee1e40 100644 --- a/coverage/backward.py +++ b/coverage/backward.py @@ -4,7 +4,7 @@ # (Redefining built-in blah) # The whole point of this file is to redefine built-ins, so shut up about it. -import os +import os, sys # Python 2.3 doesn't have `set` try: @@ -43,6 +43,12 @@ else: Returns the exit code and the combined stdout and stderr. """ + + if sys.hexversion > 0x03000000 and cmd.startswith("coverage "): + # We don't have a coverage command on 3.x, so fix it up to call the + # script. + cmd = "python " + sys.prefix + os.sep + "Scripts" + os.sep + cmd + proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT diff --git a/test/test_farm.py b/test/test_farm.py index d7b40b3..239dac0 100644 --- a/test/test_farm.py +++ b/test/test_farm.py @@ -129,7 +129,8 @@ class FarmTestCase(object): cwd = self.cd(rundir) try: for cmd in cmds.split("\n"): - if not cmd.strip(): + cmd = cmd.strip() + if not cmd: continue retcode, output = run_command(cmd) print output, |