Passed
Push — main ( 4b9dc0...1b55d1 )
by Douglas
06:16 queued 02:32
created

tests.conftest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A caplog() 0 9 1
1
import logging
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3
import pytest
0 ignored issues
show
introduced by
Unable to import 'pytest'
Loading history...
4
from _pytest.logging import caplog as _caplog
0 ignored issues
show
introduced by
Unable to import '_pytest.logging'
Loading history...
Unused Code introduced by
Unused caplog imported from _pytest.logging as _caplog
Loading history...
5
from loguru import logger
0 ignored issues
show
introduced by
Unable to import 'loguru'
Loading history...
6
7
8
# see: https://loguru.readthedocs.io/en/stable/resources/migration.html#making-things-work-with-pytest-and-caplog
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (113/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
9
@pytest.fixture
10
def caplog(_caplog):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
11
    class PropogateHandler(logging.Handler):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
12
        def emit(self, record):
13
            logging.getLogger(record.name).handle(record)
14
15
    handler_id = logger.add(PropogateHandler(), format="{message} {extra}")
16
    yield _caplog
17
    logger.remove(handler_id)
18
19
20
__all__ = ["caplog"]
21