forked from jneight/django-db-geventpool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.py
44 lines (37 loc) · 894 Bytes
/
runtests.py
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
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
import sys
import gevent.monkey
gevent.monkey.patch_all()
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
import psycogreen.gevent
psycogreen.gevent.patch_psycopg()
import django
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django_db_geventpool.backends.postgresql_psycopg2',
'NAME': 'test',
'USER': 'postgres',
'PASSWORD': 'postgres',
'ATOMIC_REQUESTS': False,
'CONN_MAX_AGE': 0,
}
},
INSTALLED_APPS=(
'tests',
'django_db_geventpool',
),
USE_TZ=True,
)
django.setup()
test_runner = DiscoverRunner(verbosity=2)
failures = test_runner.run_tests(['tests'])
if failures:
sys.exit(failures)