-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup.cfg: Require 100% test coverage
Implements pytest, replacing `manage.py test`, using the standard coala template. A .nocover.yaml is added to list the areas not yet fully covered by tests, so that all future commits are required to maintain code coverage. Related to #175
- Loading branch information
Showing
9 changed files
with
207 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coala-bears | ||
git+https://gitlab.com/virresh/coala-antlr.git | ||
{% include 'test-requirements.txt.jj2' %} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
overrides: coala.yaml | ||
|
||
allow_generic_no_cover: true | ||
|
||
nocover_file_globs: | ||
# These all need to be covered by tests | ||
- activity/*.py | ||
- community/git.py | ||
- data/*.py | ||
- gci/*.py | ||
- gsoc/*.py | ||
- log/*.py | ||
- meta_review/handler.py | ||
- model/*.py | ||
- openhub/*.py | ||
- twitter/*.py | ||
# Optional coverage. Once off scripts. | ||
- inactive_issues/inactive_issues_scraper.py | ||
- unassigned_issues/unassigned_issues_scraper.py | ||
# The following rules can remain here | ||
# django db | ||
- '*/migrations/*.py' | ||
# django commands and related modules | ||
- '*/management/commands/*.py' | ||
- meta_review/load_from_db.py | ||
- meta_review/dump_to_db.py | ||
# django-distill runs these | ||
- community/urls.py | ||
- '*/views.py' | ||
# tests | ||
- '*/tests/*.py' | ||
|
||
nocover_regexes: | ||
# community/config.py | ||
- def get_api_key | ||
# meta_review/models.py | ||
- def clear_score | ||
- def __str__ |
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 |
---|---|---|
@@ -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) |
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 |
---|---|---|
@@ -0,0 +1,112 @@ | ||
[bdist_wheel] | ||
python-tag = py34.py35.py36 | ||
|
||
[tool:pytest] | ||
minversion = 3.6.1 | ||
|
||
DJANGO_SETTINGS_MODULE = community.settings | ||
|
||
testpaths = | ||
community | ||
activity | ||
inactive_issues | ||
data | ||
gci | ||
gsoc | ||
log | ||
meta_review | ||
openhub | ||
model | ||
unassigned_issues | ||
|
||
python_files = *Test.py | ||
python_classes = *Test | ||
|
||
addopts = | ||
-r a | ||
-p no:logging | ||
--color=yes | ||
--doctest-glob=*.rst | ||
--doctest-modules | ||
--doctest-ignore-import-error | ||
--error-for-skips | ||
--cov | ||
--instafail | ||
--profile | ||
--reorder 'requirements.txt' 'test-requirements.txt' '*' | ||
|
||
doctest_optionflags = | ||
ELLIPSIS | ||
IGNORE_EXCEPTION_DETAIL | ||
|
||
reqsfilenamepatterns = | ||
requirements.txt | ||
test-requirements.txt | ||
|
||
reqsignorevcs = True | ||
|
||
timeout = 35 | ||
|
||
[coverage:coverage_env_plugin] | ||
markers = True | ||
|
||
[coverage:run] | ||
branch = True | ||
cover_pylib = False | ||
|
||
plugins = | ||
coverage_env_plugin | ||
coverage_config_reload_plugin | ||
|
||
source = | ||
community | ||
activity | ||
inactive_issues | ||
data | ||
gci | ||
gsoc | ||
log | ||
meta_review | ||
openhub | ||
model | ||
unassigned_issues | ||
|
||
omit = | ||
tests/* | ||
activity/*.py | ||
community/git.py | ||
data/*.py | ||
gci/*.py | ||
gsoc/*.py | ||
log/*.py | ||
meta_review/handler.py | ||
model/*.py | ||
openhub/*.py | ||
twitter/*.py | ||
inactive_issues/inactive_issues_scraper.py | ||
unassigned_issues/unassigned_issues_scraper.py | ||
*/migrations/*.py | ||
*/management/commands/*.py | ||
meta_review/load_from_db.py | ||
meta_review/dump_to_db.py | ||
community/urls.py | ||
*/views.py | ||
*/tests/*.py | ||
|
||
[coverage:report] | ||
fail_under = 100 | ||
show_missing = True | ||
skip_covered = False | ||
sort = Miss | ||
exclude_lines = | ||
pragma: no ?cover | ||
pragma ${PLATFORM_SYSTEM}: no cover | ||
pragma ${OS_NAME}: no cover | ||
pragma Python [0-9.,]*${PYTHON_VERSION}[0-9.,]*: no cover | ||
def get_api_key | ||
def clear_score | ||
def __str__ | ||
|
||
[coverage:force_end_of_section] |
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,3 +1,24 @@ | ||
coala-bears | ||
moban | ||
git+https://gitlab.com/virresh/coala-antlr.git | ||
coverage~=4.3.4 | ||
coverage-env-plugin~=0.1 | ||
coverage-config-reload-plugin~=0.2 | ||
codecov~=2.0.5 | ||
moban~=0.0.9 | ||
packaging~=16.8 | ||
pytest~=3.6.1 | ||
pytest-cov~=2.4 | ||
pytest-django~=3.3.3 | ||
pytest-env~=0.6.0 | ||
pytest-error-for-skips~=1.0 | ||
pytest-instafail~=0.3.0 | ||
pytest-mock~=1.1 | ||
pytest-profiling~=1.3.0 | ||
pytest-reorder~=0.1.0 | ||
pytest-reqs~=0.0.6 | ||
pytest-timeout~=1.3.0 | ||
pytest-travis-fold~=1.3.0 | ||
pytest-xdist~=1.15 | ||
requests-mock~=1.2 | ||
pip!=9.0.2, !=10.0.*, !=18.0 | ||
wheel~=0.29 |