Skip to content

Commit 6bbe35c

Browse files
committed
setup.cfg: Use template
Related to coala/meta#117
1 parent c11558a commit 6bbe35c

File tree

5 files changed

+58
-18
lines changed

5 files changed

+58
-18
lines changed

.moban.dt/bears-setup.cfg.jj2

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% extends 'setup.cfg.jj2' %}
2+
{% set packages = ['bears', '.ci'] %}
3+
{% block extra_pytest_addopts %}
4+
--ignore=tests/python/bandit_test_files/
5+
{% endblock %}

.moban.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
overrides: bear-requirements.yaml
1+
overrides: .nocover.yaml
22

33
name: coala-bears
44
description: "Bears for coala (Code Analysis Application)"
@@ -11,6 +11,8 @@ branch: master
1111
package_module: bears
1212
docs_source_dir: API
1313
docs_dir: docs
14+
test_prevent_skips: false
15+
1416
entry_points:
1517
coalabears:
1618
- coala_official_bears = bears
@@ -25,6 +27,7 @@ configuration:
2527
configuration_dir: ../coala-mobans/
2628
targets:
2729
- setup.py: bears-setup.py.jj2
30+
- setup.cfg: bears-setup.cfg.jj2
2831
- requirements.txt: requirements.txt.jj2
2932
- test-requirements.txt: bears-test-requirements.txt.jj2
3033
- bears/VERSION: VERSION.jj2

.nocover.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
overrides: bear-requirements.yaml
2+
3+
allow_generic_no_cover: true
4+
5+
nocover_file_globs:
6+
- .ci/*

setup.cfg

+33-17
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,45 @@
22
python-tag = py34.py35.py36
33

44
[tool:pytest]
5-
norecursedirs =
6-
.git
7-
dist
8-
build
9-
venv
10-
.env
11-
.vendor
12-
vendor
13-
tests/python/bandit_test_files
14-
tests/python/pyroma_test_files
5+
minversion = 3.6.1
6+
7+
testpaths =
8+
bears
9+
tests
10+
1511
python_files = *Test.py
1612
python_classes = *Test
17-
timeout = 35
13+
1814
addopts =
19-
--color=yes
20-
--ignore=test-requirements.txt
21-
--profile
15+
-r a
16+
-p no:logging
17+
--color=yes
18+
--doctest-glob=*.rst
19+
--doctest-modules
20+
--doctest-ignore-import-error
21+
--cov
22+
--instafail
23+
--profile
24+
--reorder 'requirements.txt' 'test-requirements.txt' '*'
25+
--ignore=tests/python/bandit_test_files/
26+
27+
doctest_optionflags =
28+
ELLIPSIS
29+
IGNORE_EXCEPTION_DETAIL
30+
2231
env =
23-
PYTHONHASHSEED=0
24-
# PYTHONHASHSEED=0 is required to use same hashes in pytests-xdist's workers
32+
PYTEST=1
33+
2534
python_paths = .ci/
2635

36+
reqsfilenamepatterns =
37+
requirements.txt
38+
test-requirements.txt
39+
40+
reqsignorevcs = True
41+
42+
timeout = 35
43+
2744
[coverage:coverage_env_plugin]
2845
markers = True
2946

@@ -42,7 +59,6 @@ omit =
4259
tests/*
4360
setup.py
4461
.ci/*
45-
tests/python/bandit_test_files/
4662

4763
[coverage:report]
4864
fail_under = 100

tests/conftest.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Allow import to fail to avoid annoying developers
2+
try:
3+
from pytest_reqs import check_requirements
4+
except ImportError:
5+
check_requirements = None
6+
7+
8+
if check_requirements:
9+
def pytest_collection_modifyitems(config, session, items):
10+
check_requirements(config, session, items)

0 commit comments

Comments
 (0)