Skip to content

Commit 1caa0d6

Browse files
committed
Showing tests being run
1 parent 860f654 commit 1caa0d6

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4242
4343
- name: Run tests with unittest and collect coverage
44-
run: python -m coverage run --omit="*/test*,/usr/lib*" -m unittest -v
44+
run: python -m coverage run --omit="*/test*,/usr/lib*" -m tests
4545

4646
- name: Upload coverage reports to Codecov
4747
uses: codecov/codecov-action@v3

tests/__main__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import unittest
2+
3+
class VerboseResult(unittest.TextTestResult):
4+
def startTest(self, test):
5+
# print(f"\n→ Running: {test}")
6+
super().startTest(test)
7+
8+
class VerboseRunner(unittest.TextTestRunner):
9+
resultclass = VerboseResult
10+
11+
if __name__ == "__main__":
12+
# Use test discovery manually to avoid the __main__ confusion
13+
loader = unittest.TestLoader()
14+
suite = loader.discover(start_dir="tests")
15+
16+
runner = VerboseRunner(verbosity=2)
17+
runner.run(suite)

0 commit comments

Comments
 (0)