55import sentry_sdk
66from sentry_sdk import _experimental_logger as sentry_logger
77
8- if sys .version_info < (3 , 7 ):
9- pytest .skip ("requires python3.7 or higher" )
108
9+ minimum_python_37 = pytest .mark .skipif (
10+ sys .version_info < (3 , 7 ), reason = "Asyncio tests need Python >= 3.7"
11+ )
1112
13+
14+ @minimum_python_37
1215def test_logs_disabled_by_default (sentry_init , capture_envelopes ):
1316 sentry_init ()
1417 envelopes = capture_envelopes ()
@@ -23,6 +26,7 @@ def test_logs_disabled_by_default(sentry_init, capture_envelopes):
2326 assert len (envelopes ) == 0
2427
2528
29+ @minimum_python_37
2630def test_logs_basics (sentry_init , capture_envelopes ):
2731 sentry_init (_experiments = {"enable_sentry_logs" : True })
2832 envelopes = capture_envelopes ()
@@ -57,6 +61,7 @@ def test_logs_basics(sentry_init, capture_envelopes):
5761 assert envelopes [5 ].items [0 ].payload .json ["severityNumber" ] == 21
5862
5963
64+ @minimum_python_37
6065def test_logs_before_emit_log (sentry_init , capture_envelopes ):
6166 def _before_log (record , hint ):
6267 assert list (record .keys ()) == [
@@ -96,6 +101,7 @@ def _before_log(record, hint):
96101 assert envelopes [3 ].items [0 ].payload .json ["severityText" ] == "warn"
97102
98103
104+ @minimum_python_37
99105def test_logs_attributes (sentry_init , capture_envelopes ):
100106 """
101107 Passing arbitrary attributes to log messages.
@@ -147,6 +153,7 @@ def test_logs_attributes(sentry_init, capture_envelopes):
147153 }
148154
149155
156+ @minimum_python_37
150157def test_logs_message_params (sentry_init , capture_envelopes ):
151158 """
152159 This is the official way of how to pass vars to log messages.
@@ -198,6 +205,7 @@ def test_logs_message_params(sentry_init, capture_envelopes):
198205 }
199206
200207
208+ @minimum_python_37
201209def test_logs_tied_to_transactions (sentry_init , capture_envelopes ):
202210 """
203211 Log messages are also tied to transactions.
@@ -215,6 +223,7 @@ def test_logs_tied_to_transactions(sentry_init, capture_envelopes):
215223 }
216224
217225
226+ @minimum_python_37
218227def test_logs_tied_to_spans (sentry_init , capture_envelopes ):
219228 """
220229 Log messages are also tied to spans.
0 commit comments