Skip to content

Commit

Permalink
Merge pull request #4 from sfc-gh-plis/patch-1
Browse files Browse the repository at this point in the history
Fix type hints
  • Loading branch information
mcarans authored Oct 4, 2023
2 parents 3cde9ef + 24df12d commit 72d5399
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pytest_loguru/plugin.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
from typing import Iterator # pragma: no cover

import pytest # pragma: no cover
from _pytest.logging import LogCaptureFixture # pragma: no cover
from loguru import logger # pragma: no cover


@pytest.fixture
def caplog(caplog: LogCaptureFixture) -> None:
def caplog(caplog: LogCaptureFixture) -> Iterator[LogCaptureFixture]:
"""Emitting logs from loguru's logger.log means that they will not show up in
caplog which only works with Python's standard logging. This adds the same
LogCaptureHandler being used by caplog to hook into loguru.
Args:
caplog (LogCaptureFixture): caplog fixture
Returns:
None
Yields:
LogCaptureFixture
"""

def filter_(record):
Expand Down

0 comments on commit 72d5399

Please sign in to comment.