forked from hearsaycorp/normalize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.py
executable file
·38 lines (28 loc) · 856 Bytes
/
run_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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
$ ./run_tests.py -s -v normalize.test_foo
"""
import os
import sys
try:
import nose
except ImportError:
recommend = (
"pip install nose unittest2 -r requirements.txt" if
"VIRTUAL_ENV" in os.environ else
"sudo easy_install nose unittest2 richenum"
)
sys.stderr.write(
"Running the tests requires Nose. Try:\n\n{cmd}\n\nAborting.\n"
.format(cmd=recommend)
)
sys.exit(1)
args = [] if "distutils" in sys.modules else sys.argv[1:]
nose.main(argv=['nosetests'] + args)