-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathruntests.py
30 lines (26 loc) · 818 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
import subprocess
import os
import sys
import unittest
thisdir = os.path.dirname(os.path.abspath(__file__))
os.chdir(thisdir + '/tests/')
sys.path.insert(0, thisdir)
os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
def call(command, output=False):
pop = subprocess.Popen(command, shell=True, bufsize=1024,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while True:
out = pop.stdout.read()
err = pop.stderr.read()
if out:
print out
if err:
print err
if not (out or err):
break
def run():
call("python %s/tests/bootstrap.py" % thisdir)
call("%s/tests/bin/buildout -c %s/tests/buildout.cfg" % (thisdir, thisdir))
call("%s/tests/bin/test" % thisdir, True)
if __name__ == '__main__':
run()