wagtail/runtests.py

30 wiersze
705 B
Python
Czysty Zwykły widok Historia

#!/usr/bin/env python
2014-02-17 11:03:41 +00:00
import sys
import os
import shutil
import warnings
from django.core.management import execute_from_command_line
from wagtail.tests.settings import STATIC_ROOT, MEDIA_ROOT
os.environ['DJANGO_SETTINGS_MODULE'] = 'wagtail.tests.settings'
def runtests():
# Don't ignore DeprecationWarnings
warnings.simplefilter('default', DeprecationWarning)
warnings.simplefilter('default', PendingDeprecationWarning)
argv = sys.argv[:1] + ['test'] + sys.argv[1:]
try:
execute_from_command_line(argv)
finally:
shutil.rmtree(STATIC_ROOT, ignore_errors=True)
2014-02-23 14:57:33 +00:00
shutil.rmtree(MEDIA_ROOT, ignore_errors=True)
if __name__ == '__main__':
runtests()