Skip to content

Commit fa396ab

Browse files
committed
add log capture test to increase coverage
1 parent 046b996 commit fa396ab

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

{{cookiecutter.project_name}}/tests/test_my_module.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
"""
55
import pytest
66
from {{ cookiecutter.package_name }} import my_module
7+
from testfixtures import LogCapture
8+
9+
10+
def test_log_capture(caplog):
11+
with LogCapture() as lc:
12+
my_module.example()
13+
14+
lc.check(
15+
('{{ cookiecutter.package_name }}.my_module', 'INFO', 'Providing information about the excecution of the function.')
16+
)
717

818

919
def test_module_import():

0 commit comments

Comments
 (0)