Skip to content

Commit 42d7903

Browse files
authored
Merge pull request #137 from AFM-SPM/ns-rse/pytest-loguru
2 parents c5bf96d + 0f8769a commit 42d7903

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ pypi = [
7070
tests = [
7171
"pytest",
7272
"pytest-cov",
73+
"pytest-loguru",
7374
]
7475

7576
[project.urls]

tests/conftest.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,12 @@
44

55
import pySPM
66
import pytest
7-
from _pytest.logging import LogCaptureFixture
87

9-
from AFMReader.logging import logger
108

119
BASE_DIR = Path.cwd()
1210
RESOURCES = BASE_DIR / "tests" / "resources"
1311

1412

15-
@pytest.fixture()
16-
def caplog(caplog: LogCaptureFixture): # pylint: disable=redefined-outer-name
17-
"""Instantiate the logging capture for loguru."""
18-
handler_id = logger.add(
19-
caplog.handler,
20-
format="{message}",
21-
level=0,
22-
filter=lambda record: record["level"].no >= caplog.handler.level,
23-
enqueue=False, # Set to 'True' if your test is spawning child processes.
24-
)
25-
yield caplog
26-
logger.remove(handler_id)
27-
28-
2913
@pytest.fixture()
3014
def spm_channel_data() -> pySPM.SPM.SPM_image:
3115
"""Instantiate channel data from a LoadScans object."""

0 commit comments

Comments
 (0)