Benjamin Peterson  committed 08e9289

remove usage of exception module, which is gone in py3.3

  • Participants
  • Parent commits 7aab1fc

Comments (0)

Files changed (2)

File _pytest/

         # we want to catch a AssertionError
         # replace our subclass with the builtin one
         # see
-        from exceptions import AssertionError as ExpectedException
+        from _pytest.assertion.util import BuiltinAssertionError as ExpectedException
     if not args:
         return RaisesContext(ExpectedException)

File testing/

     def test_raises_flip_builtin_AssertionError(self):
         # we replace AssertionError on python level
         # however c code might still raise the builtin one
-        import exceptions
+        from _pytest.assertion.util import BuiltinAssertionError
-            raise exceptions.AssertionError
+            raise BuiltinAssertionError
     @pytest.mark.skipif('sys.version < "2.5"')