Skip to content

Commit 5c69af9

Browse files
committed
Disable logging in schemathesis tests
1 parent 2416bf0 commit 5c69af9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_integration/test_openapi/test_schema.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import logging
2+
from collections.abc import Iterator
13
from typing import TYPE_CHECKING
24

35
import pytest
@@ -28,6 +30,14 @@ def _patch_response_validation(monkeypatch: pytest.MonkeyPatch) -> None:
2830
)
2931

3032

33+
@pytest.fixture(autouse=True)
34+
def _disable_logging(settings: LazySettings) -> Iterator[None]:
35+
# Logging has too much output with schemathesis:
36+
logging.disable(logging.CRITICAL)
37+
yield
38+
logging.disable(logging.NOTSET)
39+
40+
3141
# The `transactional_db` fixture is required to enable database access.
3242
# When `st.openapi.from_wsgi()` makes a WSGI request, Django's request
3343
# lifecycle triggers database operations.

0 commit comments

Comments
 (0)