Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def test():
  2. import sys
  3. mod = sys.modules[__name__]
  4. testfuncs = [getattr(mod, name) for name in dir(mod) if name.startswith('test_')]
  5. [tf() for tf in sorted(testfuncs, key=lambda f:f.__code__.co_firstlineno)]
  6. print('ran %i tests' % len(testfuncs))
  7.  
  8.  
  9. test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement