File tree Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ pypi = [
70
70
tests = [
71
71
" pytest" ,
72
72
" pytest-cov" ,
73
+ " pytest-loguru" ,
73
74
]
74
75
75
76
[project .urls ]
Original file line number Diff line number Diff line change 4
4
5
5
import pySPM
6
6
import pytest
7
- from _pytest .logging import LogCaptureFixture
8
7
9
- from AFMReader .logging import logger
10
8
11
9
BASE_DIR = Path .cwd ()
12
10
RESOURCES = BASE_DIR / "tests" / "resources"
13
11
14
12
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
-
29
13
@pytest .fixture ()
30
14
def spm_channel_data () -> pySPM .SPM .SPM_image :
31
15
"""Instantiate channel data from a LoadScans object."""
You can’t perform that action at this time.
0 commit comments