File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 55
66import litestar
77import pytest
8+ from sentry_sdk .transport import Transport as SentryTransport
89
910import microbootstrap .settings
1011from microbootstrap import (
2223from microbootstrap .settings import BaseServiceSettings , ServerConfig
2324
2425
26+ if typing .TYPE_CHECKING :
27+ from sentry_sdk .envelope import Envelope as SentryEnvelope
28+
29+
2530pytestmark = [pytest .mark .anyio ]
2631
2732
@@ -35,9 +40,17 @@ def default_litestar_app() -> litestar.Litestar:
3540 return litestar .Litestar ()
3641
3742
43+ class MockSentryTransport (SentryTransport ):
44+ def capture_envelope (self , envelope : SentryEnvelope ) -> None : ...
45+
46+
3847@pytest .fixture
3948def minimal_sentry_config () -> SentryConfig :
40- return SentryConfig (
sentry_dsn = "https://[email protected] /0" ,
sentry_tags = {
"test" :
"test" })
49+ return SentryConfig (
50+ sentry_dsn = "https://[email protected] /0" ,
51+ sentry_tags = {"test" : "test" },
52+ sentry_additional_params = {"transport" : MockSentryTransport ()},
53+ )
4154
4255
4356@pytest .fixture
You can’t perform that action at this time.
0 commit comments