Skip to content

Commit 1681f5c

Browse files
committed
remove assertNoLogs for Python < 3.10 compatibility
1 parent 3cd93c9 commit 1681f5c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

exporter/opentelemetry-exporter-otlp-proto-common/tests/test_retryable_exporter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ def test_export_no_retry(self):
3939
export_func.reset_mock()
4040
export_func.configure_mock(return_value=result_type.FAILURE)
4141
pos_arg = Mock()
42-
with self.assertNoLogs(exporter_logger, level=WARNING):
43-
result = exporter.export_with_retry(
44-
_DEFAULT_EXPORT_TIMEOUT_S, pos_arg, foo="bar"
45-
)
42+
with self.assertRaises(AssertionError):
43+
with self.assertLogs(exporter_logger, level=WARNING):
44+
result = exporter.export_with_retry(
45+
_DEFAULT_EXPORT_TIMEOUT_S, pos_arg, foo="bar"
46+
)
4647
self.assertIs(result, result_type.FAILURE)
4748
export_func.assert_called_once_with(ANY, pos_arg, foo="bar")
4849

0 commit comments

Comments
 (0)