Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tox to run the test suite against all supported Pythons #147

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[run]
parallel = True
branch = True
source = jsonpath_ng, tests

[report]
fail_under = 82
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run tests
run: make test
run: tox run -e py${{ matrix.python-version }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
\#(
.\#*

# Built artifacts
# Build and test artifacts
/README.txt
/dist
/*.egg-info
parser.out
.coverage
.cache
.coverage
.coverage.*
.tox/

build
/jsonpath_rw/VERSION
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ lint:
@flake8 --exclude=tests .

test: clean
@echo "$(OK_COLOR)==> Runnings tests ...$(NO_COLOR)"
@pytest -s -v --capture sys --cov jsonpath_ng --cov-report term-missing

coverage:
@coverage run --source jsonpath_ng -m pytest
@coverage report
@echo "$(OK_COLOR)==> Running tests ...$(NO_COLOR)"
@tox

tag:
@echo "$(OK_COLOR)==> Creating tag $(version) ...$(NO_COLOR)"
Expand Down
5 changes: 1 addition & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
pytest
tox
flake8
coverage
pytest-cov
pytest-randomly
48 changes: 48 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[tox]
min_version = 4.3.5

envlist =
coverage-erase
py{3.12, 3.11, 3.10, 3.9, 3.8, 3.7}
coverage-report

skip_missing_interpreters = True
isolated_build = True


[testenv]
package = wheel
wheel_build_env = build_wheel

depends =
py{3.12, 3.11, 3.10, 3.9, 3.8, 3.7}: coverage-erase
deps =
coverage[toml]
pytest
pytest-randomly
commands =
coverage run -m pytest


[testenv:coverage-erase]
no_package = true
skip_install = true
deps =
coverage[toml]
commands =
coverage erase


[testenv:coverage-report]
depends =
py{3.12, 3.11, 3.10, 3.9, 3.8, 3.7}
no_package = true
skip_install = true
deps =
coverage[toml]
commands_pre =
- coverage combine
commands =
coverage report
command_post =
coverage html --fail-under=0