Skip to content

Commit 1b58396

Browse files
committed
change example fucntion and update the test
1 parent ad0cffb commit 1b58396

3 files changed

Lines changed: 4 additions & 20 deletions

File tree

{{cookiecutter.project_name}}/setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ dev =
5656
sphinx
5757
sphinx_rtd_theme
5858
recommonmark
59-
testfixtures
6059
publishing =
6160
twine
6261
wheel

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,10 @@
44
"""
55
import pytest
66
from {{ cookiecutter.package_name }} import my_module
7-
from testfixtures import LogCapture
87

98

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-
)
17-
18-
19-
def test_module_import():
20-
assert my_module not in sys.modules
9+
def test_hello():
10+
assert my_module.hello('nlesc') == 'Hello nlesc!'
2111

2212

2313
def test_something():
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
"""Documentation about the {{ cookiecutter.package_name }} module."""
2-
import logging
3-
4-
5-
logger = logging.getLogger(__name__)
6-
72

83
# FIXME: put actual code here
9-
def example():
10-
logger.info("Providing information about the excecution of the function.")
4+
def hello(name):
5+
return f'Hello {name}!'

0 commit comments

Comments
 (0)