dpaste/runtests.py

25 lines
543 B
Python
Raw Permalink Normal View History

2013-11-26 08:44:36 +11:00
#!/usr/bin/env python
2018-04-29 20:00:00 +10:00
2017-03-19 00:08:36 +11:00
2013-11-26 08:44:36 +11:00
import sys
2014-12-15 04:03:35 +11:00
2018-03-12 21:59:38 +11:00
from django import setup
2013-11-26 08:44:36 +11:00
from django.conf import settings
2018-03-12 21:59:38 +11:00
from django.test.runner import DiscoverRunner as TestRunner
from dpaste.settings import tests as test_settings
2013-11-26 08:44:36 +11:00
def runtests(*test_args):
2015-08-12 14:22:26 +10:00
# Setup settings
if not settings.configured:
2018-03-12 21:59:38 +11:00
settings.configure(**test_settings.__dict__)
setup()
test_runner = TestRunner(verbosity=1)
2015-08-12 14:22:26 +10:00
failures = test_runner.run_tests(['dpaste'])
2013-11-26 08:44:36 +11:00
if failures:
sys.exit(failures)
if __name__ == '__main__':
runtests(*sys.argv[1:])