Skip to content

Commit b2a6ba0

Browse files
committed
debug: flush stdout errors, make test run faster
1 parent f6c7e6d commit b2a6ba0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/_test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232
uses: Swatinem/rust-cache@v2
3333
with:
3434
key: rust-${{ matrix.platform.runner }}-${{ matrix.python-version }}
35-
- name: Rust build
36-
run: cargo build --verbose
3735
- name: Rust tests
3836
run: cargo test --verbose
3937

@@ -53,9 +51,9 @@ jobs:
5351
- name: Python build
5452
run: |
5553
${{ matrix.platform.python_exec }} -m maturin develop -E all
56-
- name: Python type check (mypy)
57-
run: |
58-
${{ matrix.platform.python_exec }} -m mypy python
5954
- name: Python tests
6055
run: |
61-
${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests
56+
${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests
57+
- name: Python type check (mypy)
58+
run: |
59+
${{ matrix.platform.python_exec }} -m mypy python

python/cocoindex/tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ def _cocoindex_windows_env_fixture(
1515

1616
yield
1717

18+
print("Test done.")
19+
sys.stdout.flush()
1820
if not sys.platform.startswith("win"):
1921
return
2022

2123
try:
2224
print("Shutdown the subprocess pool at exit in hook.")
25+
sys.stdout.flush()
26+
2327
import cocoindex.subprocess_exec
2428

2529
original_sigint_handler = signal.getsignal(signal.SIGINT)
@@ -29,6 +33,9 @@ def _cocoindex_windows_env_fixture(
2933

3034
# If any test failed, let pytest exit normally with nonzero code
3135
if request.session.testsfailed == 0:
36+
print("Exit with success.")
37+
sys.stdout.flush()
38+
3239
os._exit(0) # immediate success exit (skips atexit/teardown)
3340

3441
finally:

0 commit comments

Comments
 (0)