-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests_execution.py
More file actions
33 lines (23 loc) · 910 Bytes
/
Copy pathtests_execution.py
File metadata and controls
33 lines (23 loc) · 910 Bytes
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
import os
import nrt_logging
from nrt_logging.test.tests_suite import TestsSuite
PATH = os.path.dirname(__file__)
def __replace_pyproject_version():
with open(os.path.join(PATH, 'pyproject.toml')) as f:
file_lines = [line.strip() for line in f.readlines()]
is_replace = False
for i, line in enumerate(file_lines):
if line.startswith('version'):
version = line.split('=')[1]
if version != nrt_logging.__version__:
is_replace = True
file_lines[i] = f"version='{nrt_logging.__version__}'"
if is_replace:
with open(os.path.join(PATH, 'pyproject.toml'), 'w') as f:
f.write('\n'.join(file_lines))
##################################################################
__replace_pyproject_version()
test_suite = TestsSuite(True)
test_suite.run_tests()
test_suite.create_report()
test_suite.erase_data()