0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/runtests.py
Karl Hobley f4706b8208 Ignore ResourceWarnings
This switches Python back to it's default behaviour. Elasticsearch creates a lot of noise with this warning switched on, hiding warnings that may be important.
2015-10-29 10:21:56 +00:00

30 lines
705 B
Python
Executable File

#!/usr/bin/env python
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)
shutil.rmtree(MEDIA_ROOT, ignore_errors=True)
if __name__ == '__main__':
runtests()