conftest.py 305 B

123456789101112
  1. import logging
  2. import pytest
  3. import unittest.mock
  4. from cipy import _handler
  5. @pytest.fixture(scope="function")
  6. def ci_logger(monkeypatch: pytest.MonkeyPatch) -> unittest.mock.Mock:
  7. mock = unittest.mock.Mock(spec=logging.Formatter)
  8. monkeypatch.setattr(_handler, "formatter", mock)
  9. yield mock