Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import logging
  2. import sys
  3.  
  4. import nose
  5.  
  6. logging.basicConfig(level=logging.INFO)
  7.  
  8. #here are some tests in this module
  9. def test_me():
  10. pass
  11.  
  12. if __name__ == '__main__':
  13. #This code will run the test in this file.'
  14.  
  15. module_name = sys.modules[__name__].__file__
  16. logging.debug("running nose for package: %s", module_name)
  17.  
  18. result = nose.run(argv=[sys.argv[0],
  19. module_name,
  20. '-v'])
  21. logging.info("all tests ok: %s", result)
  22.  
  23. test_module.test_me ... ok
  24.  
  25. ----------------------------------------------------------------------
  26. Ran 1 test in 0.001s
  27.  
  28. OK
  29. INFO:root:all tests ok: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement