Skip to content

Commit

Permalink
bring template code and ruff config in sync (Refs #336)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwmeijer authored and sjvrijn committed Oct 18, 2023
1 parent f2e4267 commit 672fa63
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions {{cookiecutter.directory_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ select = [
]
ignore = [
'D100', # Missing module docstring
'D104', # Missing public package docstring
# The following list excludes rules irrelevant to the Google style
'D203',
'D204',
Expand Down
2 changes: 0 additions & 2 deletions {{cookiecutter.directory_name}}/setup.py
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()
8 changes: 5 additions & 3 deletions {{cookiecutter.directory_name}}/tests/test_my_module.py
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!'
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Documentation about {{ cookiecutter.package_name }}"""
"""Documentation about {{ cookiecutter.package_name }}."""
import logging


logging.getLogger(__name__).addHandler(logging.NullHandler())

__author__ = "{{ cookiecutter.full_name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# FIXME: put actual code here
def hello(name):
"""Say hello
"""Say hello.
Function docstring using Google docstring style.
Expand Down

0 comments on commit 672fa63

Please sign in to comment.