summaryrefslogtreecommitdiff
path: root/test/coveragetest.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-09-22 07:22:56 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-09-22 07:22:56 -0400
commitff9099051e0daff7b08035713eeca5696ab3217a (patch)
tree13a391e9010e9e0b99ff403ec2fd0252d460ab5a /test/coveragetest.py
parente3c0b4b2c7d2a92344d30a25467a1e863bbb7d31 (diff)
downloadpython-coveragepy-git-ff9099051e0daff7b08035713eeca5696ab3217a.tar.gz
The best way to get py3k support: same source runs on both, with some contortions.
Diffstat (limited to 'test/coveragetest.py')
-rw-r--r--test/coveragetest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py
index 1502770d..638c10d6 100644
--- a/test/coveragetest.py
+++ b/test/coveragetest.py
@@ -1,10 +1,10 @@
"""Base test case class for coverage testing."""
import imp, os, random, shutil, sys, tempfile, textwrap, unittest
-from cStringIO import StringIO
import coverage
-from coverage.backward import set, run_command # pylint: disable-msg=W0622
+from coverage.backward import set, StringIO # pylint: disable-msg=W0622
+from backtest import run_command
class Tee(object):
@@ -168,7 +168,8 @@ class CoverageTest(unittest.TestCase):
"""
try:
callableObj(*args, **kwargs)
- except excClass, exc:
+ except excClass:
+ _, exc, _ = sys.exc_info()
excMsg = str(exc)
if not msg:
# No message provided: it passes.
@@ -214,7 +215,7 @@ class CoverageTest(unittest.TestCase):
os.environ['PYTHONPATH'] = pypath
_, output = run_command(cmd)
- print output
+ print(output)
return output
def assert_equal_sets(self, s1, s2):