We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ae1eff commit e453b14Copy full SHA for e453b14
tests/conftest.py
@@ -1,5 +1,8 @@
1
+import logging
2
import pytest
3
+from _pytest.logging import caplog as _caplog
4
from pythclient.solana import SolanaClient
5
+from loguru import logger
6
7
8
@pytest.fixture
@@ -8,3 +11,13 @@ def solana_client():
11
endpoint="https://example.com",
9
12
ws_endpoint="wss://example.com",
10
13
)
14
+
15
+@pytest.fixture
16
+def caplog(_caplog):
17
+ class PropogateHandler(logging.Handler):
18
+ def emit(self, record):
19
+ logging.getLogger(record.name).handle(record)
20
21
+ handler_id = logger.add(PropogateHandler(), format="{message}")
22
+ yield _caplog
23
+ logger.remove(handler_id)
0 commit comments