From ebe6b22c9eb4469dd33675e246d914da94bb7ab3 Mon Sep 17 00:00:00 2001 From: Christophe Papazian Date: Wed, 27 Sep 2023 13:25:29 +0200 Subject: [PATCH] improve flask test --- tests/contrib/flask/test_flask_appsec.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/contrib/flask/test_flask_appsec.py b/tests/contrib/flask/test_flask_appsec.py index 08736eca9e..1bd1517d5f 100644 --- a/tests/contrib/flask/test_flask_appsec.py +++ b/tests/contrib/flask/test_flask_appsec.py @@ -938,13 +938,15 @@ def new_service(service_name): ddtrace.Pin.override(flask.Flask, service=service_name, tracer=ddtrace.tracer) return "Ok %s" % service_name, 200 - self._aux_appsec_prepare_tracer() - resp = self.client.get("/new_service/awesome_test") - assert resp.status_code == 200 - assert get_response_body(resp) == "Ok awesome_test" - for _ in range(10): - time.sleep(1) - if "awesome_test" in ddtrace.config._get_extra_services(): - break - else: - raise AssertionError("extra service not found") + with override_global_config(dict(_remote_config_enabled=True)): + self._aux_appsec_prepare_tracer() + assert ddtrace.config._remote_config_enabled + resp = self.client.get("/new_service/awesome_test") + assert resp.status_code == 200 + assert get_response_body(resp) == "Ok awesome_test" + for _ in range(10): + time.sleep(1) + if "awesome_test" in ddtrace.config._get_extra_services(): + break + else: + raise AssertionError("extra service not found")