Ned Batchelder avatar Ned Batchelder committed 4554fde

Fix the new test for py3, and add a test for #212.

Comments (0)

Files changed (1)

tests/test_arcs.py

             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."
                 )
                 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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.