nosewrapper.py 739 B

12345678910111213141516171819202122232425
  1. """ This script simply gets the paths correct for testing eventlet with the
  2. hub extension for Nose."""
  3. import nose
  4. from os.path import dirname, realpath, abspath
  5. import sys
  6. parent_dir = dirname(dirname(realpath(abspath(__file__))))
  7. if parent_dir not in sys.path:
  8. sys.path.insert(0, parent_dir)
  9. # hacky hacks: skip test__api_timeout when under 2.4 because otherwise it SyntaxErrors
  10. if sys.version_info < (2,5):
  11. argv = sys.argv + ["--exclude=.*_with_statement.*"]
  12. else:
  13. argv = sys.argv
  14. # hudson does a better job printing the test results if the exit value is 0
  15. zero_status = '--force-zero-status'
  16. if zero_status in argv:
  17. argv.remove(zero_status)
  18. launch = nose.run
  19. else:
  20. launch = nose.main
  21. launch(argv=argv)