Skip to content

Commit 7287013

Browse files
committed
Consolidate reset.
1 parent c379ad0 commit 7287013

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

datadog_lambda/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def fips_mode_enabled(self):
5454
)
5555
return self._config_fips_mode_enabled
5656

57-
def reset(self):
57+
def _reset(self):
5858
for attr in dir(self):
5959
if attr.startswith("_config_"):
6060
delattr(self, attr)

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
@pytest.fixture(autouse=True)
77
def reset_config():
8-
config.reset()
8+
config._reset()

tests/test_metric.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from datadog.api.exceptions import ClientError
88

99
from datadog_lambda.api import KMS_ENCRYPTION_CONTEXT_KEY, decrypt_kms_api_key
10-
from datadog_lambda.config import config
1110
from datadog_lambda.metric import (
1211
MetricsHandler,
1312
_select_metrics_handler,
@@ -20,7 +19,6 @@
2019

2120
class TestLambdaMetric(unittest.TestCase):
2221
def setUp(self):
23-
config.reset()
2422
lambda_stats_patcher = patch("datadog_lambda.metric.lambda_stats")
2523
self.mock_metric_lambda_stats = lambda_stats_patcher.start()
2624
self.addCleanup(lambda_stats_patcher.stop)

tests/test_tracing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from ddtrace._trace._span_pointer import _SpanPointerDirection
1616
from ddtrace._trace._span_pointer import _SpanPointerDescription
1717

18-
from datadog_lambda.config import config
1918
from datadog_lambda.constants import (
2019
SamplingPriority,
2120
TraceHeader,
@@ -972,7 +971,6 @@ def test_convert_xray_sampling(self):
972971

973972
class TestLogsInjection(unittest.TestCase):
974973
def setUp(self):
975-
config.reset()
976974
patcher = patch("datadog_lambda.tracing.get_dd_trace_context_obj")
977975
self.mock_get_dd_trace_context = patcher.start()
978976
self.mock_get_dd_trace_context.return_value = Context(

0 commit comments

Comments
 (0)