Skip to content

Commit bab8e4a

Browse files
kurtmckeemichaelmior
authored andcommitted
Use tox to run the test suite against all supported Pythons
1 parent b974d4f commit bab8e4a

File tree

6 files changed

+60
-13
lines changed

6 files changed

+60
-13
lines changed

.coveragerc

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[run]
2+
parallel = True
23
branch = True
34
source = jsonpath_ng, tests
5+
6+
[report]
7+
fail_under = 82

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
pip install -r requirements.txt
3333
pip install -r requirements-dev.txt
3434
- name: Run tests
35-
run: make test
35+
run: tox run -e py${{ matrix.python-version }}

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
\#(
77
.\#*
88

9-
# Built artifacts
9+
# Build and test artifacts
1010
/README.txt
1111
/dist
1212
/*.egg-info
1313
parser.out
14-
.coverage
1514
.cache
15+
.coverage
16+
.coverage.*
17+
.tox/
1618

1719
build
1820
/jsonpath_rw/VERSION

Makefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ lint:
2323
@flake8 --exclude=tests .
2424

2525
test: clean
26-
@echo "$(OK_COLOR)==> Runnings tests ...$(NO_COLOR)"
27-
@pytest -s -v --capture sys --cov jsonpath_ng --cov-report term-missing
28-
29-
coverage:
30-
@coverage run --source jsonpath_ng -m pytest
31-
@coverage report
26+
@echo "$(OK_COLOR)==> Running tests ...$(NO_COLOR)"
27+
@tox
3228

3329
tag:
3430
@echo "$(OK_COLOR)==> Creating tag $(version) ...$(NO_COLOR)"

requirements-dev.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
pytest
1+
tox
22
flake8
3-
coverage
4-
pytest-cov
5-
pytest-randomly

tox.ini

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[tox]
2+
min_version = 4.3.5
3+
4+
envlist =
5+
coverage-erase
6+
py{3.12, 3.11, 3.10, 3.9, 3.8, 3.7}
7+
coverage-report
8+
9+
skip_missing_interpreters = True
10+
isolated_build = True
11+
12+
13+
[testenv]
14+
package = wheel
15+
wheel_build_env = build_wheel
16+
17+
depends =
18+
py{3.12, 3.11, 3.10, 3.9, 3.8, 3.7}: coverage-erase
19+
deps =
20+
coverage[toml]
21+
pytest
22+
pytest-randomly
23+
commands =
24+
coverage run -m pytest
25+
26+
27+
[testenv:coverage-erase]
28+
no_package = true
29+
skip_install = true
30+
deps =
31+
coverage[toml]
32+
commands =
33+
coverage erase
34+
35+
36+
[testenv:coverage-report]
37+
depends =
38+
py{3.12, 3.11, 3.10, 3.9, 3.8, 3.7}
39+
no_package = true
40+
skip_install = true
41+
deps =
42+
coverage[toml]
43+
commands_pre =
44+
- coverage combine
45+
commands =
46+
coverage report
47+
command_post =
48+
coverage html --fail-under=0

0 commit comments

Comments
 (0)