Skip to content

Commit

Permalink
Test: Add config of coverage and integrate with setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjr0719 committed Jun 10, 2019
1 parent 1079e15 commit 30a9915
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
@@ -0,0 +1,6 @@
[run]
source = sanic_openapi
branch = True

[html]
directory = test_reports/coverage
51 changes: 43 additions & 8 deletions .gitignore
Expand Up @@ -8,20 +8,24 @@ __pycache__/

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -36,13 +40,15 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
Expand All @@ -51,6 +57,8 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -65,27 +73,54 @@ docs/_build/
# PyBuilder
target/

# IPython Notebook
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# dotenv
.env
# SageMath parsed files
*.sage.py

# virtualenv
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

.idea
sanic/*
# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

test_reports/
5 changes: 5 additions & 0 deletions setup.cfg
@@ -0,0 +1,5 @@
[tool:pytest]
addopts=--durations=0 --html=test_reports/report.html --self-contained-html --cov=sanic_openapi --cov-config .coveragerc --cov-report html

[aliases]
test=pytest
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -15,6 +15,7 @@
"coverage==4.5.3",
"pytest==4.6.2",
"pytest-cov==2.7.1",
"pytest-html==1.20.0",
"pytest-runner==5.1",
"tox==3.12.1",
]
Expand Down

0 comments on commit 30a9915

Please sign in to comment.