forked from saxix/django-adminactions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
35 lines (23 loc) · 671 Bytes
/
conftest.py
File metadata and controls
35 lines (23 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import sys
from django.conf import settings
def pytest_configure(config):
here = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(here, 'demo'))
if not settings.configured:
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
try:
from django.apps import AppConfig
import django
django.setup()
except ImportError:
pass
def runtests(args=None):
import pytest
if not args:
args = []
if not any(a for a in args[1:] if not a.startswith('-')):
args.append('adminactions')
sys.exit(pytest.main(args))
if __name__ == '__main__':
runtests(sys.argv)