Skip to content

Commit

Permalink
fix(travis): fix pytest codestyle and docstyle for makefile and travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Fahy committed Nov 22, 2019
1 parent fb1aaf9 commit c539e7e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -9,7 +9,7 @@ install:
script:
- flake8
- mypy bff tests
- pytest --codestyle --docstyle
- pytest --pycodestyle --pydocstyle
- pytest --pylint --pylint-rcfile=.pylintrc --pylint-error-types=CWEF
- pytest --cov=bff tests
after_success:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -44,7 +44,7 @@ lint:
style:
flake8
mypy bff tests
pytest --codestyle --docstyle
pytest --pycodestyle --pydocstyle

.PHONY: coverage
coverage:
Expand Down
29 changes: 18 additions & 11 deletions setup.cfg
Expand Up @@ -12,25 +12,32 @@ description-file = README.md
[flake8]
max-line-length = 100
ignore = F841, # Local variable name is assigned to but never used.
W503 # Line break occurred before a binary operator
W503 # Line break occurred before a binary operator.
exclude =
.git,
venv*,
.eggs,
__pycache__,
build/,
dist/,
doc/,
venv*/,
versioneer.py,
bff/_version.py,
setup.py
doc

[tool:pytest]
testpaths = bff
docstyle_convention = numpy
docstyle_add_ignore = D401
codestyle_max_line_length = 100
markers = mpl_image_compare: mark a test for image comparison.

[mypy]
ignore_missing_imports=True
no_implicit_optional=True

[mypy-bff._version]
ignore_errors=True

[pycodestyle]
max_line_length = 100

[pydocstyle]
convention = numpy
add_ignore = D401 # First line should be in imperative mood.

[tool:pytest]
testpaths = tests
markers = mpl_image_compare: mark a test for image comparison.
4 changes: 2 additions & 2 deletions tests/test_config.py
Expand Up @@ -21,7 +21,7 @@ def test_create_config(self):
Test of loading the config when it does not exists.
"""
# Default configuration
config_default = FancyConfig()
__ = FancyConfig()

default_path_ok = Path(__file__).resolve().parent.parent.joinpath('bff/config.yml')
default_path_ko = Path.home().resolve().joinpath('config.yml')
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_access_config(self):

# Check the error message using a mock.
with unittest.mock.patch('logging.Logger.error') as mock_logging:
config['error']
__ = config['error']
mock_logging.assert_called_with('Configuration for error does not exist.')

# Remove the file.
Expand Down

0 comments on commit c539e7e

Please sign in to comment.