-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.py
More file actions
executable file
·52 lines (40 loc) · 1.38 KB
/
run_tests.py
File metadata and controls
executable file
·52 lines (40 loc) · 1.38 KB
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
48
49
50
51
52
#!/usr/bin/env python
# This file is closely based on run_tests.py from metadatastore which
# was closely based on tests.py from matplotlib
#
# This allows running tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# or just ./run-tests.py
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description of
# these options.
import os
import uuid
import nose
# from skxray.testing.noseclasses import KnownFailure
# plugins = [KnownFailure]
plugins = []
env = {"NOSE_WITH_COVERAGE": 1,
'NOSE_COVER_PACKAGE': 'metadatastore',
'NOSE_COVER_HTML': 1}
# Nose doesn't automatically instantiate all of the plugins in the
# child processes, so we have to provide the multiprocess plugin with
# a list.
from nose.plugins import multiprocess
multiprocess._instantiate_plugins = plugins
# Use an obvious name for test fixture db's so it's clear where they
# came from and that they're junk, if they get left around due to a bug.
suffixroot = '_db_lib__test_tmp_'
suffix = '{0}{1}'.format(suffixroot, str(uuid.uuid4()))
os.environ['DB_LIB_SUFFIXROOT'] = suffixroot
os.environ['DB_LIB_SUFFIX'] = suffix
# enable this to not drop test databases after testing
#os.environ['DB_LIB_KEEP_TEST_DB'] = '1'
def run():
nose.main(addplugins=[x() for x in plugins], env=env)
if __name__ == '__main__':
run()