Skip to content

Instantly share code, notes, and snippets.

@fdemmer
Created January 4, 2015 15:12
Show Gist options
  • Save fdemmer/b46b0c92769777471c52 to your computer and use it in GitHub Desktop.
Save fdemmer/b46b0c92769777471c52 to your computer and use it in GitHub Desktop.
Log statement for every test method
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)
@fdemmer
Copy link
Author

fdemmer commented Jan 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment