diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-05-03 20:58:23 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-05-03 20:58:23 -0400 |
commit | ce76f771e3760d1260e56ae2968a5170b12c2c13 (patch) | |
tree | 5c482742fb27e0c76ff4bf7363e97b50a8fe88b1 | |
parent | b33d4557dd46651034bc37030565e6b2a362ee6c (diff) | |
download | python-coveragepy-git-ce76f771e3760d1260e56ae2968a5170b12c2c13.tar.gz |
Fix the new test for py3, and add a test for #212.
-rw-r--r-- | tests/test_arcs.py | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py index f3c5fc34..f09af8c1 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -172,9 +172,9 @@ if sys.version_info >= (2, 6): self.check_coverage("""\ for i in range(2): with open("test", "w") as f: - print 3 - print 4 - print 5 + print(3) + print(4) + print(5) """, arcz=".1 12 23 34 41 15 5." ) @@ -510,6 +510,26 @@ class ExceptionArcTest(CoverageTest): arcz=".1 12 23 35 56 61 17 7.", arcz_missing="", arcz_unpredicted="") + def test_bug_212(self): + self.check_coverage("""\ + def b(exc): + try: + while True: + raise Exception(exc) + except Exception as e: + if e.args != ('expected',): + raise e + q = 1 + + b('expected') + try: + b('unexpected') + except: + pass + """, + arcz=".1 .2 1A 23 34 56 67 68 8. 85 AB BC C. DE E.", + arcz_missing="") + if sys.version_info >= (2, 5): # Try-except-finally was new in 2.5 def test_except_finally(self): |