docstr: Show it is not possible to filter secrets in the source.
  
  It is not possible to (regularly/reliably) filter out secrets that
  appear directly in the source code. This is because the formatting of
  exc_info is not done in the filter, it is done after the filter is
  called, and fixing this "properly" is hard/impossible.
  
  (It would likely need to construct a custom traceback that changed the
  source. I have no idead if that is even possible)
  
  This test illustrates that, but ix marked xfail in case someone wants to
  fix this later.
docstr_tok: ["Show","it","is","not","possible","to","filter","secrets","in","the","source",".","It","is","not","possible","to","(","regularly\/reliably",")","filter","out","secrets","that","appear","directly","in","the","source","code",".","This","is","because","the","formatting","of","exc_info","is","not","done","in","the","filter",",","it","is","done","after","the","filter","is","called",",","and","fixing","this","``","properly","''","is","hard\/impossible",".","(","It","would","likely","need","to","construct","a","custom","traceback","that","changed","the","source",".","I","have","no","idead","if","that","is","even","possible",")","This","test","illustrates","that",",","but","ix","marked","xfail","in","case","someone","wants","to","fix","this","later","."]
code: def test_exc_tb(self, logger, caplog):
      """
      Show it is not possible to filter secrets in the source.
  
      It is not possible to (regularly/reliably) filter out secrets that
      appear directly in the source code. This is because the formatting of
      exc_info is not done in the filter, it is done after the filter is
      called, and fixing this "properly" is hard/impossible.
  
      (It would likely need to construct a custom traceback that changed the
      source. I have no idead if that is even possible)
  
      This test illustrates that, but ix marked xfail in case someone wants to
      fix this later.
      """
      try:
          raise RuntimeError("Cannot connect to user:password")
      except RuntimeError:
          logger.exception("Err")
  
      line = lineno() - 4
  
      assert caplog.text == textwrap.dedent(
          f"""\
              ERROR Err
              Traceback (most recent call last):
                File ".../test_secrets_masker.py", line {line}, in test_exc_tb
                  raise RuntimeError("Cannot connect to user:***)
              RuntimeError: Cannot connect to user:***
              """
      )
  
imports: from __future__ import annotations
  import contextlib
  import inspect
  import logging
  import logging.config
  import os
  import sys
  import textwrap
  from enum import Enum
  from io import StringIO
  from unittest.mock import patch
  import pytest
  from airflow import settings
  from airflow.utils.log.secrets_masker import RedactedIO, SecretsMasker, mask_secret, redact, should_hide_value_for_key
  from airflow.utils.state import DagRunState, JobState, State, TaskInstanceState
  from tests.test_utils.config import conf_vars
label_desc: Use image node_id 6 for calling the TestSecretsMasker obj's underlying member method code with example usage: obj.test_exc_tb(logger, caplog) without return types