# HG changeset patch # User Thomas De Schampheleire # Date 2016-03-15 17:55:19 # Node ID 91b89797a775ccd68c9710967532d4813779b317 # Parent 72e8508d9758294bb71f0dbd3142b2c5fc384381 pytest migration: add temporary assertRaises wrapper Similar to the other temporary unittest-assert wrappers, add the missing assertRaises and forward to pytest.raises. diff --git a/kallithea/tests/__init__.py b/kallithea/tests/__init__.py --- a/kallithea/tests/__init__.py +++ b/kallithea/tests/__init__.py @@ -272,3 +272,6 @@ class TestControllerPytest(BaseTestContr assert first == second def assertDictEqual(self, first, second, msg=None): assert first == second + def assertRaises(self, exception, method): + with pytest.raises(exception): + method()