On Aug 4, 2006, at 7:46 AM, Jorge Vargas wrote: Hi Hi, if using a unittest.TestCase subclass for your tests (like TG's DBTest) you can use the failUnlessRaises method. class TestMyApp(TestCase): def test_int(self): """ test that int("a") raises a ValueError """ self.failUnlessRaises(ValueError, int, "a") # As in your example: def test_create(self): self.failUnlessRaises(NotImplementedError, source.create) HTH, Alberto --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~--- |
- [TurboGears] Re: how to test for exceptions with nose? Alberto Valverde
- [TurboGears] Re: how to test for exceptions with nos... Jorge Vargas
- [TurboGears] Re: how to test for exceptions with... Alberto Valverde
- [TurboGears] Re: how to test for exceptions ... Jorge Vargas
- [TurboGears] Re: how to test for exceptions with nos... Jorge Vargas
- [TurboGears] Re: how to test for exceptions with... Kevin Dangoor
- [TurboGears] Re: how to test for exceptions ... Jorge Vargas
- [TurboGears] Re: how to test for excepti... Jorge Vargas
- [TurboGears] Re: how to test for excepti... Michele Cella
- [TurboGears] Re: how to test for ex... Jorge Vargas

