Created
July 19, 2017 08:18
-
-
Save samueljackson92/0284ee3dbe41a495459515f8622231a0 to your computer and use it in GitHub Desktop.
Useful python functions
This file contains 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
def printname(func): | |
""" | |
Prints the name of a decorated method | |
This can be useful for debugging unit tests which | |
interfere with each other. | |
""" | |
def wrapper(self): | |
print func.__name__ | |
return func(self) | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment