-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.py
executable file
·58 lines (46 loc) · 1.42 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
# flake8: noqa
"""Run the tests with https://pytest.org."""
import pathlib
import platform
import sys
import pytest
SELF = pathlib.Path(__file__)
ARGS = [#'--run-writes',
#'--skip-slow',
#'--skip-pandas',
#'--skip-sqlparse',
#'-k', 'not reads',
#'--collect-only',
#'--capture', 'no', # a.k.a '-s'
#'--verbose',
#'--showlocals', # a.k.a. '-l'
#'--pdb',
#'--exitfirst', # a.k.a. '-x'
#'-W', 'error',
#'--loglevel-debug',
#'--log-sql',
#'--no-sqlalchemy-warn-20',
#'--file-engine',
#'--glottolog-tag', 'master',
#'--glottolog-tag', 'v4.4',
#'--glottolog-tag', 'v4.3-treedb-fixes',
#'--glottolog-tag', 'v4.2.1',
#'--glottolog-tag', 'v4.1',
#'--glottolog-repo-root', './glottolog/',
#'--rebuild', '--force-rebuild',
#'--exclude-raw',
]
if 'idlelib' in sys.modules:
ARGS += ['--capture', 'sys', '--color', 'no']
if platform.system() == 'Windows':
ARGS.append('--pdb')
print('run', [SELF.name] + sys.argv[1:])
if '--installed' in sys.argv[1:]:
sys.argv[1:] = [a for a in sys.argv[1:] if a != '--installed']
path_item = sys.path.pop(0)
print(f'removed {path_item!r} from sys.path')
ARGS += ['--import-mode', 'append']
args = ARGS + sys.argv[1:]
print(f'pytest.main({args!r})')
sys.exit(pytest.main(args))