Capture logging config events for DictConfigurator objects. This suppresses the event (so the configuration doesn't happen). Returns a list of (args, kwargs).
(monkeypatch)
| 856 | |
| 857 | @pytest.fixture() |
| 858 | def 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") |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…