Skip to content

Commit 8cb9d08

Browse files
committed
chore: fix CI pytest -p no:logging
1 parent 0792ce7 commit 8cb9d08

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ jobs:
3535
mypy linux_edr/
3636
- name: Test with pytest
3737
run: |
38-
uv run pytest --cov=linux_edr
39-
uv run python -m coverage xml
38+
uv run pytest --cov=linux_edr -p no:logging --disable-pytest-warnings --cov-report=xml
4039
- name: Upload coverage to Codecov
4140
uses: codecov/codecov-action@v3
4241
with:

conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from _pytest._io.terminalwriter import TerminalWriter
2+
3+
_orig_flush = TerminalWriter.flush
4+
5+
def _safe_flush(self, *args, **kwargs):
6+
try:
7+
return _orig_flush(self, *args, **kwargs)
8+
except OSError as e:
9+
if e.errno == 9: # Bad file descriptor
10+
return
11+
raise
12+
13+
TerminalWriter.flush = _safe_flush

0 commit comments

Comments
 (0)