-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
38 lines (29 loc) · 1.07 KB
/
test.py
File metadata and controls
38 lines (29 loc) · 1.07 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
import os.path
import subprocess
import sys
from pathlib import Path
import neatest
def git_push():
cwd = Path(__file__).parent
branch = subprocess.check_output(["git", "branch"], cwd=cwd) \
.decode().split()[-1]
if branch != "dev":
raise ValueError(f"Unexpected current GIT branch: {branch}")
subprocess.check_call(["git", "add", "."], cwd=cwd)
subprocess.check_call(["git", "commit", "-m",
f"Autocommit from {os.path.basename(__file__)}. "
f"All tests passed"],
cwd=cwd)
subprocess.check_call(["git", "push"], cwd=cwd)
def run():
a = sys.argv[1] if len(sys.argv) >= 2 else None
if a == "lint" or not a:
print("Running mypy...")
package_dir_path = 'tempground'
subprocess.check_call([sys.executable, '-m', 'mypy', package_dir_path,
'--pretty'])
if a == "unit" or not a:
neatest.run(verbosity=neatest.Verbosity.normal,
buffer=True)
if __name__ == "__main__":
run()