Created
January 4, 2015 15:12
-
-
Save fdemmer/b46b0c92769777471c52 to your computer and use it in GitHub Desktop.
Log statement for every test method
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 | |
import inspect | |
class TestLists(unittest.TestCase): | |
def logPoint(self): | |
currentTest = self.id().split('.')[-1] | |
callingFunction = inspect.stack()[1][3] | |
print 'in %s - %s()' % (currentTest, callingFunction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from http://pythontesting.net/framework/unittest/unittest-fixtures/