amoghrajesh commented on code in PR #55259:
URL: https://github.com/apache/airflow/pull/55259#discussion_r2322389888


##########
shared/secrets_masker/tests/secrets_masker/test_secrets_masker.py:
##########
@@ -243,10 +253,15 @@ def test_masking_in_explicit_context_exceptions(self, 
logger, caplog):
         ],
     )
     def test_mask_secret(self, name, value, expected_mask):
-        filt = SecretsMasker()
-        filt.add_mask(value, name)
+        from airflow_shared.secrets_masker.secrets_masker import 
_secrets_masker
+        filt = _secrets_masker()
+        configure_secrets_masker_for_test(filt)
 
-        assert filt.patterns == expected_mask
+        try:
+            filt.add_mask(value, name)
+            assert filt.patterns == expected_mask
+        finally:
+            reset_secrets_masker()

Review Comment:
   > Why do we need to reset anything? Aren't all the changes made on to the 
filt object?
   
   We do not, using the `filt` object



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to