You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

runtests.py 992B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. import sys
  3. import logging
  4. from tests.config import configure
  5. logging.disable(logging.CRITICAL)
  6. def run_tests(*test_args):
  7. from django_nose import NoseTestSuiteRunner
  8. test_runner = NoseTestSuiteRunner()
  9. if not test_args:
  10. test_args = ['tests']
  11. num_failures = test_runner.run_tests(test_args)
  12. if num_failures:
  13. sys.exit(num_failures)
  14. if __name__ == '__main__':
  15. args = sys.argv[1:]
  16. if not args:
  17. args = ['-s', '-x', '--processes=4']
  18. else:
  19. # Some args specified. Check to see if any nose options have been
  20. # specified. If they have, then don't set any
  21. has_options = any(map(lambda x: x.startswith('--'), args))
  22. if not has_options:
  23. args.extend(['-s', '-x', '--with-specplugin'])
  24. else:
  25. # Remove options as nose will pick these up from sys.argv
  26. args = [arg for arg in args if not arg.startswith('-')]
  27. configure()
  28. run_tests(*args)