forked from MolecularAI/reinvent-scoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.py
32 lines (23 loc) · 825 Bytes
/
main_test.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
#!/usr/bin/env python
# coding=utf-8
import pytest
import argparse
TESTS_FOLDER = 'unittest_reinvent'
parser = argparse.ArgumentParser(description='Run reinvent_scoring tests')
parser.add_argument(
'--unittests', action='store_true',
help='Only run unittests (Please indicate either integration or unittests flag)'
)
parser.add_argument(
'--integration', action='store_true',
help='Only run integration tests (Please indicate either integration or unittests flag)'
)
args, _ = parser.parse_known_args()
if args.unittests:
pytest_args = ['-m', 'not integration', TESTS_FOLDER]
elif args.integration:
pytest_args = ['-m', 'integration', TESTS_FOLDER]
else:
raise Exception('Please provide either --unittests or --integration flag.')
if __name__ == '__main__':
pytest.main(pytest_args)