MCPcopy Create free account
hub / github.com/ipython/traitlets / caplogconfig

Function caplogconfig

tests/config/test_application.py:858–876  ·  view source on GitHub ↗

Capture logging config events for DictConfigurator objects. This suppresses the event (so the configuration doesn't happen). Returns a list of (args, kwargs).

(monkeypatch)

Source from the content-addressed store, hash-verified

856
857@pytest.fixture()
858def caplogconfig(monkeypatch):
859 """Capture logging config events for DictConfigurator objects.
860
861 This suppresses the event (so the configuration doesn't happen).
862
863 Returns a list of (args, kwargs).
864 """
865 calls = []
866
867 def _configure(*args, **kwargs):
868 nonlocal calls
869 calls.append((args, kwargs))
870
871 monkeypatch.setattr(
872 "logging.config.DictConfigurator.configure",
873 _configure,
874 )
875
876 return calls
877
878
879@pytest.mark.skipif(sys.implementation.name == "pypy", reason="Test does not work on pypy")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…