Skip to content

Commit 4818875

Browse files
committed
tests: Improve test_all a bit
1 parent dd087f4 commit 4818875

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/test_all.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'test_iir_q15',
1111
'test_kmeans',
1212
'test_linreg',
13-
'test_linreg_california',
13+
#'test_linreg_california',
1414
'test_neighbors',
1515
'test_trees',
1616
]
@@ -21,13 +21,15 @@ def main():
2121
# Default: all
2222

2323
modules = TEST_MODULES
24-
#if sys.argv
24+
if len(sys.argv) >= 2:
25+
modules = sys.argv[1].split(',')
2526

2627
passed = 0
2728
failed = 0
2829

2930
for module_name in modules:
3031
mod = None
32+
print(f'{module_name}:')
3133
try:
3234
mod = __import__(module_name)
3335
except Exception as e:
@@ -41,16 +43,17 @@ def main():
4143
tests = [ o for o in module_attributes if o.startswith('test_') ]
4244
for test_name in tests:
4345
test_function = getattr(mod, test_name)
46+
print(f'{module_name}.py/{test_name}:')
4447
try:
4548
test_function()
4649
except Exception as e:
47-
print(f'{module_name}.py/{test_name}: FAIL')
50+
print(f'\tFAIL')
4851
sys.print_exception(e)
4952
print() # spacing for readability
5053
failed += 1
5154
continue
5255

53-
print(f'{module_name}.py/{test_name}: PASS')
56+
print(f'\t PASS')
5457
passed += 1
5558

5659
print(f'Passed: {passed}')

0 commit comments

Comments
 (0)