Skip to content

Commit

Permalink
chore: fix urlib asm test
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Jan 6, 2025
1 parent 81208cd commit 2676f57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/contrib/urllib3/test_urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from tests.opentracer.utils import init_tracer
from tests.utils import TracerTestCase
from tests.utils import snapshot
from ddtrace.settings.asm import config as asm_config
from tests.utils import override_global_config


# host:port of httpbin_local container
Expand Down Expand Up @@ -535,7 +537,8 @@ def test_distributed_tracing_apm_opt_out_true(self):
self.tracer.enabled = False
with mock.patch(
"urllib3.connectionpool.HTTPConnectionPool._make_request", side_effect=ValueError
) as m_make_request:
) as m_make_request, override_global_config(dict(_appsec_standalone_enabled=True, _asm_enabled=True)):
assert asm_config._apm_opt_out
with pytest.raises(ValueError):
self.http.request("GET", URL_200)

Expand Down Expand Up @@ -582,7 +585,8 @@ def test_distributed_tracing_apm_opt_out_false(self):
self.tracer.enabled = False
with mock.patch(
"urllib3.connectionpool.HTTPConnectionPool._make_request", side_effect=ValueError
) as m_make_request:
) as m_make_request, override_global_config(dict(_appsec_standalone_enabled=False, _asm_enabled=True)):
assert not asm_config._apm_opt_out
with pytest.raises(ValueError):
self.http.request("GET", URL_200)

Expand Down

0 comments on commit 2676f57

Please sign in to comment.