From ce76f771e3760d1260e56ae2968a5170b12c2c13 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 3 May 2013 20:58:23 -0400 Subject: Fix the new test for py3, and add a test for #212. --- tests/test_arcs.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'tests') 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): -- cgit v1.2.1