Created
October 5, 2012 17:37
-
-
Save lincolndbryant/3841214 to your computer and use it in GitHub Desktop.
TestCase that does not catch exceptions so you can debug them interactively
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
""" | |
When you user code or assertions throw exceptions, default behavior is to aggregate and report these, calls to each test method are wrapped in try:. When it is preferrable to handle these with a debugger and step back into frames of user code, this subclass this TestCase which uses .debug() rather then .run() | |
""" | |
class DebuggableTestCase(unittest.TestCase): | |
def __call__(self, *args, **kwargs): | |
return self.debug() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment