Commits

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/python.py

         # we want to catch a AssertionError
         # replace our subclass with the builtin one
         # see https://bitbucket.org/hpk42/pytest/issue/176/pytestraises
-        from exceptions import AssertionError as ExpectedException
+        from _pytest.assertion.util import BuiltinAssertionError as ExpectedException
 
     if not args:
         return RaisesContext(ExpectedException)

File testing/test_python.py

     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
         pytest.raises(AssertionError,"""
-            raise exceptions.AssertionError
+            raise BuiltinAssertionError
         """)
 
     @pytest.mark.skipif('sys.version < "2.5"')