-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bring template code and ruff config in sync (Refs #336)
- Loading branch information
Showing
5 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/usr/bin/env python | ||
import os | ||
from setuptools import setup | ||
|
||
|
||
# see setup.cfg | ||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
"""Tests for the {{ cookiecutter.package_name }}.my_module module. | ||
""" | ||
"""Tests for the {{ cookiecutter.package_name }}.my_module module.""" | ||
import pytest | ||
|
||
from {{ cookiecutter.package_name }}.my_module import hello | ||
|
||
|
||
def test_hello(): | ||
"""Example using assert.""" | ||
assert hello('nlesc') == 'Hello nlesc!' | ||
|
||
|
||
def test_hello_with_error(): | ||
"""Example of testing for raised errors.""" | ||
with pytest.raises(ValueError) as excinfo: | ||
hello('nobody') | ||
assert 'Can not say hello to nobody' in str(excinfo.value) | ||
|
||
|
||
@pytest.fixture | ||
def some_name(): | ||
"""Example fixture.""" | ||
return 'Jane Smith' | ||
|
||
|
||
def test_hello_with_fixture(some_name): | ||
"""Example using a fixture.""" | ||
assert hello(some_name) == 'Hello Jane Smith!' |
3 changes: 1 addition & 2 deletions
3
{{cookiecutter.directory_name}}/{{cookiecutter.package_name}}/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters