Skip to content

Commit

Permalink
setup.cfg: Use template
Browse files Browse the repository at this point in the history
Related to coala/meta#117
  • Loading branch information
jayvdb committed Nov 11, 2018
1 parent c11558a commit 6bbe35c
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .moban.dt/bears-setup.cfg.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends 'setup.cfg.jj2' %}
{% set packages = ['bears', '.ci'] %}
{% block extra_pytest_addopts %}
--ignore=tests/python/bandit_test_files/
{% endblock %}
5 changes: 4 additions & 1 deletion .moban.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
overrides: bear-requirements.yaml
overrides: .nocover.yaml

name: coala-bears
description: "Bears for coala (Code Analysis Application)"
Expand All @@ -11,6 +11,8 @@ branch: master
package_module: bears
docs_source_dir: API
docs_dir: docs
test_prevent_skips: false

entry_points:
coalabears:
- coala_official_bears = bears
Expand All @@ -25,6 +27,7 @@ configuration:
configuration_dir: ../coala-mobans/
targets:
- setup.py: bears-setup.py.jj2
- setup.cfg: bears-setup.cfg.jj2
- requirements.txt: requirements.txt.jj2
- test-requirements.txt: bears-test-requirements.txt.jj2
- bears/VERSION: VERSION.jj2
Expand Down
6 changes: 6 additions & 0 deletions .nocover.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
overrides: bear-requirements.yaml

allow_generic_no_cover: true

nocover_file_globs:
- .ci/*
50 changes: 33 additions & 17 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,45 @@
python-tag = py34.py35.py36

[tool:pytest]
norecursedirs =
.git
dist
build
venv
.env
.vendor
vendor
tests/python/bandit_test_files
tests/python/pyroma_test_files
minversion = 3.6.1

testpaths =
bears
tests

python_files = *Test.py
python_classes = *Test
timeout = 35

addopts =
--color=yes
--ignore=test-requirements.txt
--profile
-r a
-p no:logging
--color=yes
--doctest-glob=*.rst
--doctest-modules
--doctest-ignore-import-error
--cov
--instafail
--profile
--reorder 'requirements.txt' 'test-requirements.txt' '*'
--ignore=tests/python/bandit_test_files/

doctest_optionflags =
ELLIPSIS
IGNORE_EXCEPTION_DETAIL

env =
PYTHONHASHSEED=0
# PYTHONHASHSEED=0 is required to use same hashes in pytests-xdist's workers
PYTEST=1

python_paths = .ci/

reqsfilenamepatterns =
requirements.txt
test-requirements.txt

reqsignorevcs = True

timeout = 35

[coverage:coverage_env_plugin]
markers = True

Expand All @@ -42,7 +59,6 @@ omit =
tests/*
setup.py
.ci/*
tests/python/bandit_test_files/

[coverage:report]
fail_under = 100
Expand Down
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Allow import to fail to avoid annoying developers
try:
from pytest_reqs import check_requirements
except ImportError:
check_requirements = None


if check_requirements:
def pytest_collection_modifyitems(config, session, items):
check_requirements(config, session, items)

0 comments on commit 6bbe35c

Please sign in to comment.