forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ComplianceAsCode#11146 from Honny1/unit-tests-with…
…-tox Running locally unit tests of `ssg` module using python2 and 3
- Loading branch information
Showing
6 changed files
with
48 additions
and
26 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,44 +1,60 @@ | ||
[tox] | ||
envlist = py27,py3{6,7,8,9,10,11},flake8,docs | ||
envlist = coverage_clean, py27, py3{6, 8, 9}, py3, coverage_report, flake8 | ||
skip_missing_interpreters = true | ||
isolated_build = true | ||
skipsdist = true | ||
|
||
[flake8] | ||
max-line-length = 99 | ||
|
||
# Unit tests | ||
[testenv] | ||
setenv = | ||
tests_dir = {toxinidir}{/}tests/unit | ||
PYTHONPATH = {toxinidir} | ||
commands = | ||
python -m pytest --cov-append --cov-report=xml --cov=ssg "{env:tests_dir}{/}ssg-module" | ||
|
||
deps = | ||
pyyaml | ||
Jinja2 | ||
-r test-requirements.txt | ||
|
||
# Coverage | ||
[testenv:coverage_report] | ||
deps = coverage | ||
skip_install = true | ||
install_command = pip install {opts} {packages} | ||
commands = | ||
coverage html | ||
coverage xml | ||
coverage report -m | ||
|
||
[testenv:coverage_clean] | ||
deps = coverage | ||
skip_install = true | ||
commands = coverage erase | ||
|
||
|
||
# Code style | ||
[flake8] | ||
max-line-length = 99 | ||
per-file-ignores =__init__.py:F401 | ||
|
||
[testenv:flake8] | ||
basepython = python3 | ||
commands = | ||
flake8 ssg utils | ||
flake8 ssg utils tests build-scripts | ||
deps = | ||
flake8 | ||
|
||
# Documentation | ||
[testenv:docs] | ||
skip_install=false | ||
skipsdist=true | ||
basepython = python3 | ||
allowlist_externals = | ||
make | ||
rm | ||
deps = | ||
-r docs/requirements.txt | ||
commands_pre = | ||
make -C docs clean | ||
rm -rf docs/api | ||
commands = | ||
make -C docs html | ||
commands_post = | ||
make -C docs linkcheck | ||
|
||
[testenv:clean] | ||
skip_install = true | ||
allowlist_externals = | ||
bash | ||
|
||
deps = | ||
pip>=21.1 | ||
|
||
commands = | ||
bash -c 'make -C docs/ clean' | ||
bash -c 'rm -rf dist/ build/* docs/api/' |