@@ -133,15 +133,10 @@ def test_quota_subject_warns_when_no_limiters(caplog: pytest.LogCaptureFixture)
133133 authentication = {"module" : "noop" },
134134 quota_handlers = {},
135135 )
136- config_logger = logging .getLogger ("models.config" )
137- config_logger .propagate = True
138- try :
139- with caplog .at_level (logging .WARNING ):
140- Configuration (** config_dict )
136+ with caplog .at_level (logging .WARNING , logger = "lightspeed_stack.models.config" ):
137+ Configuration (** config_dict )
141138
142- assert "quota enforcement is not fully configured" in caplog .text
143- finally :
144- config_logger .propagate = False
139+ assert "quota enforcement is not fully configured" in caplog .text
145140
146141
147142def test_quota_subject_warns_when_no_storage_backend (
@@ -163,12 +158,7 @@ def test_quota_subject_warns_when_no_storage_backend(
163158 ],
164159 },
165160 )
166- config_logger = logging .getLogger ("models.config" )
167- config_logger .propagate = True
168- try :
169- with caplog .at_level (logging .WARNING ):
170- Configuration (** config_dict )
171-
172- assert "quota enforcement is not fully configured" in caplog .text
173- finally :
174- config_logger .propagate = False
161+ with caplog .at_level (logging .WARNING , logger = "lightspeed_stack.models.config" ):
162+ Configuration (** config_dict )
163+
164+ assert "quota enforcement is not fully configured" in caplog .text
0 commit comments