-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
executable file
·47 lines (34 loc) · 1.23 KB
/
tests.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
45
46
47
#!/usr/lib/virtualenvs/simpledocs/bin/python
# Version 0.1.1
# Updated 2014.02.01
## About
#
# Uses system wide nosetests binary to run tests. Automatically adds
# virtualenv's site-packages.
#
# Run everything it would be done from the command line. For example turn:
# nosetests --with-coverage --cover-package=<package> --nocapture ./tests
#
# Into:
# ./tests.py --with-coverage --cover-package=<package> --nocapture ./tests
## Requirements
#
# pip install nosetests coverage
## Extending this file
#
# As command line arguments pass through to nosetests, there should be no need
# to extend or change this file. Do not add os.environ[] style settings to this
# page as it will conflict with command line arguments. Do not add an
# additional argument parsing layer using argparse or optparse.
import glob, os, sys
absolute_path = os.path.abspath(__file__)
project_dir = os.path.dirname(absolute_path)
project_name = os.path.basename(project_dir)
project_name = 'simpledocs'
virtualenv = '/usr/lib/virtualenvs/{0}'.format(project_name)
site_packages = glob.glob('{0}/lib/*/site-packages'.format(virtualenv))[0]
sys.path.insert(0, project_dir)
sys.path.insert(0, site_packages)
from app import app as application
import nose
nose.run()