Skip to content

Commit ca12f38

Browse files
committed
Test for deprecation message
1 parent 37633bc commit ca12f38

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/tracing/test_misc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,21 @@ def test_set_meaurement_public_api(sentry_init, capture_events):
295295
assert event["measurements"]["metric.bar"] == {"value": 456, "unit": "second"}
296296

297297

298+
def test_set_measurement_deprecated(sentry_init):
299+
sentry_init(traces_sample_rate=1.0)
300+
301+
with start_transaction(name="measuring stuff") as trx:
302+
with pytest.warns(DeprecationWarning):
303+
set_measurement("metric.foo", 123)
304+
305+
with pytest.warns(DeprecationWarning):
306+
trx.set_measurement("metric.bar", 456)
307+
308+
with start_span(op="measuring span") as span:
309+
with pytest.warns(DeprecationWarning):
310+
span.set_measurement("metric.baz", 420.69, unit="custom")
311+
312+
298313
@pytest.mark.parametrize(
299314
"trace_propagation_targets,url,expected_propagation_decision",
300315
[

0 commit comments

Comments
 (0)