-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (20 loc) · 715 Bytes
/
Copy pathtest.py
File metadata and controls
23 lines (20 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import subprocess
def get_submodule_paths ():
submodule_paths = []
with open ('.gitmodules') as file:
for line in file:
if 'path =' in line:
path = line.strip ().split ('= ')[1]
submodule_paths.append (path)
return submodule_paths
submodule_paths = get_submodule_paths ()
# initiate test runs
for module_dir in submodule_paths:
os.chdir (module_dir)
print (f"Entering {module_dir}")
if os.path.isfile ('requirements.txt'):
subprocess.run (['pip', 'install', '-r', 'requirements.txt'], check = True)
subprocess.run (['python', '-u', 'test.py'], check = True)
os.chdir ('..')
print (f"Exiting {module_dir}")