@@ -73,6 +73,7 @@ Running the tests
73
73
-----------------
74
74
75
75
.. To get the test output:
76
+ # Use the lowest of the PYVERSIONS
76
77
# Resize terminal width to 95
77
78
% make sterile
78
79
@@ -81,66 +82,65 @@ Running the tests
81
82
The tests are written mostly as standard unittest-style tests, and are run with
82
83
pytest running under `tox `_::
83
84
84
- $ python3 -m tox -e py38
85
- py38 : wheel-0.43.0 -py3-none-any.whl already present in /Users/ned/Library/Application Support/virtualenv/wheel/3.8 /embed/3/wheel.json
86
- py38 : pip-24.0 -py3-none-any.whl already present in /Users/ned/Library/Application Support/virtualenv/wheel/3.8 /embed/3/pip.json
87
- py38 : setuptools-69.2 .0-py3-none-any.whl already present in /Users/ned/Library/Application Support/virtualenv/wheel/3.8 /embed/3/setuptools.json
88
- py38 : install_deps> python -m pip install -U -r requirements/pip.pip -r requirements/pytest.pip -r requirements/light-threads.pip
85
+ % python3 -m tox -e py39
86
+ py39 : wheel-0.45.1 -py3-none-any.whl already present in /Users/ned/Library/Application Support/virtualenv/wheel/3.9 /embed/3/wheel.json
87
+ py39 : pip-25.0.1 -py3-none-any.whl already present in /Users/ned/Library/Application Support/virtualenv/wheel/3.9 /embed/3/pip.json
88
+ py39 : setuptools-78.1 .0-py3-none-any.whl already present in /Users/ned/Library/Application Support/virtualenv/wheel/3.9 /embed/3/setuptools.json
89
+ py39 : install_deps> python -m pip install -U -r requirements/pip.pip -r requirements/pytest.pip -r requirements/light-threads.pip
89
90
.pkg: install_requires> python -I -m pip install setuptools
90
- .pkg: _optional_hooks> python /usr/local/virtualenvs/coverage/lib/python3.8/site-packages/pyproject_api/_backend.py True setuptools.build_meta
91
- .pkg: get_requires_for_build_editable> python /usr/local/virtualenvs/coverage/lib/python3.8/site-packages/pyproject_api/_backend.py True setuptools.build_meta
92
- .pkg: install_requires_for_build_editable> python -I -m pip install wheel
93
- .pkg: build_editable> python /usr/local/virtualenvs/coverage/lib/python3.8/site-packages/pyproject_api/_backend.py True setuptools.build_meta
94
- py38: install_package_deps> python -m pip install -U 'tomli; python_full_version <= "3.11.0a6"'
95
- py38: install_package> python -m pip install -U --force-reinstall --no-deps .tox/.tmp/package/1/coverage-7.4.5a0.dev1-0.editable-cp38-cp38-macosx_14_0_arm64.whl
96
- py38: commands[0]> python igor.py zip_mods
97
- py38: commands[1]> python setup.py --quiet build_ext --inplace
98
- ld: warning: duplicate -rpath '/usr/local/pyenv/pyenv/versions/3.8.18/lib' ignored
99
- ld: warning: duplicate -rpath '/opt/homebrew/lib' ignored
100
- py38: commands[2]> python -m pip install -q -e .
101
- py38: commands[3]> python igor.py test_with_core ctrace
102
- === CPython 3.8.18 with C tracer (.tox/py38/bin/python) ===
91
+ .pkg: _optional_hooks> python /usr/local/virtualenvs/coverage/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta
92
+ .pkg: get_requires_for_build_editable> python /usr/local/virtualenvs/coverage/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta
93
+ .pkg: build_editable> python /usr/local/virtualenvs/coverage/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta
94
+ py39: install_package_deps> python -m pip install -U 'tomli; python_full_version <= "3.11.0a6"'
95
+ py39: install_package> python -m pip install -U --force-reinstall --no-deps .tox/.tmp/package/1/coverage-7.8.1a0.dev1-0.editable-cp39-cp39-macosx_15_0_arm64.whl
96
+ py39: commands[0]> python igor.py zip_mods
97
+ py39: commands[1]> python igor.py remove_extension
98
+ py39: commands[2]> python igor.py test_with_core pytrace
99
+ === CPython 3.9.21 (gil) with Python tracer (.tox/py39/bin/python) ===
103
100
bringing up nodes...
104
- ....................................................................................... [ 6%]
105
- .....................................................x...x............s......s.s....s.. [ 12%]
106
- ....................................................................................... [ 18%]
107
- ....................................................................................... [ 25%]
108
- ....................................................................................... [ 31%]
109
- ....................................................................................... [ 37%]
110
- ....................................................................................... [ 44%]
111
- ....................................................................................... [ 50%]
112
- ....................................................................................... [ 56%]
113
- ........................s...........s.................................................. [ 63%]
114
- ...........................................................................s........... [ 69%]
115
- .................................s............s.s.................s.................... [ 75%]
116
- ...........................................s........................................s.. [ 81%]
117
- ................................s...................................................... [ 88%]
101
+ ....................................................................................... [ 5%]
102
+ ..................................................................x................s... [ 11%]
103
+ ......s...s.....s....s......s.s.s.s.................................................... [ 17%]
104
+ ...........................................s..ss...ss.ss.ss............................ [ 23%]
105
+ ....................................................................................... [ 29%]
106
+ ....................................................................................... [ 35%]
107
+ ....................................................................................... [ 41%]
108
+ ................................................s...................................... [ 47%]
109
+ ....................................................................................... [ 53%]
110
+ ...................................................s..........s........................ [ 59%]
111
+ ....................................................................................... [ 65%]
112
+ ..........................ssss......................................................... [ 71%]
113
+ ..s.....s.ss..........................ss...................s.s..sssssss.ssssss.sssss... [ 77%]
114
+ .........ss..........................s...s.s......s........s........................s.. [ 83%]
115
+ .............................s......................................................... [ 88%]
118
116
....................................................................................... [ 94%]
119
- ............................................................s................... [100%]
120
- 1368 passed, 15 skipped, 2 xfailed in 13.10s
121
- py38: commands[4]> python igor.py remove_extension
122
- py38: commands[5]> python igor.py test_with_core pytrace
123
- === CPython 3.8.18 with Python tracer (.tox/py38/bin/python) ===
117
+ .............................................s.......................ss.... [100%]
118
+ 1403 passed, 63 skipped, 1 xfailed in 15.05s
119
+ py39: commands[3]> python setup.py --quiet build_ext --inplace
120
+ py39: commands[4]> python -m pip install -q -e .
121
+ py39: commands[5]> python igor.py test_with_core ctrace
122
+ === CPython 3.9.21 (gil) with C tracer (.tox/py39/bin/python) ===
124
123
bringing up nodes...
125
- ....................................................................................... [ 6%]
126
- ....................x..x.............................................s.ss...s.......... [ 12%]
127
- ..........................................................................s.ss.s..s.... [ 18%]
128
- s........s........s..s...s............................................................. [ 25%]
129
- ................s...................................................................... [ 31%]
130
- ...................s......ss..........................ssss...........................s. [ 37%]
131
- ....................................................................................... [ 43%]
132
- ....................................................................................... [ 50%]
133
- .................................................................s..................... [ 56%]
134
- ........s..s.........sss.s............................................................. [ 62%]
135
- ...................................................................ss.................. [ 69%]
136
- ..............................................ss...........s.s......................... [ 75%]
137
- ................................ssssss................................................. [ 81%]
138
- ......s...ss........ss................................................................. [ 88%]
139
- .............................................s......................................... [ 94%]
140
- .......................................................................ss....... [100%]
141
- 1333 passed, 50 skipped, 2 xfailed in 11.17s
142
- py38: OK (37.60=setup[9.10]+cmd[0.11,0.49,2.83,13.59,0.11,11.39] seconds)
143
- congratulations :) (37.91 seconds)
124
+ ....................................................................................... [ 5%]
125
+ ..........................................sx................................s.......... [ 11%]
126
+ ..........ss........s....................................s............................. [ 17%]
127
+ ..............................sss...................................................... [ 23%]
128
+ ..............................................................s........................ [ 29%]
129
+ ....................................................................................... [ 35%]
130
+ ....................................................................................... [ 41%]
131
+ ......................................................s................................ [ 47%]
132
+ .............................................s......................................... [ 53%]
133
+ .......s..................s............................................................ [ 59%]
134
+ ....................................................................................s.. [ 65%]
135
+ .......................................................ss.......................s...... [ 71%]
136
+ ....................................................s............................ss.... [ 77%]
137
+ ..........................s...................s........................................ [ 83%]
138
+ ....................................................................................... [ 88%]
139
+ ............................s......s................................................... [ 94%]
140
+ .................................................................s......... [100%]
141
+ 1440 passed, 26 skipped, 1 xfailed in 12.38s
142
+ py39: OK (40.04=setup[9.03]+cmd[0.17,0.09,15.40,0.13,2.47,12.77] seconds)
143
+ congratulations :) (40.61 seconds)
144
144
145
145
Tox runs the complete test suite a few times for each version of Python you
146
146
have installed. The first run uses the C implementation of the trace function,
@@ -165,15 +165,17 @@ respectively. The pytest ``-k`` option selects tests based on a word in their
165
165
name, which can be very convenient for ad-hoc test selection. Of course you
166
166
can combine tox and pytest options::
167
167
168
- $ python3 -m tox -q -e py310 -- -n 0 -vv -k hash
169
- ================================== test session starts ===================================
170
- platform darwin -- Python 3.10.13, pytest-8.1.1, pluggy-1.4.0 -- /Users/ned/coverage/trunk/.tox/py310/bin/python
168
+ % python3 -m tox -q -e py310 -- -n 0 -vv -k hash
169
+ Skipping tests with Python tracer: Only one core: not running pytrace
170
+ === CPython 3.10.16 (gil) with C tracer (.tox/py310/bin/python) ===
171
+ ===================================== test session starts =====================================
172
+ platform darwin -- Python 3.10.16, pytest-8.3.5, pluggy-1.5.0 -- /Users/ned/coverage/trunk/.tox/py310/bin/python
171
173
cachedir: .tox/py310/.pytest_cache
172
174
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/Users/ned/coverage/trunk/.hypothesis/examples'))
173
175
rootdir: /Users/ned/coverage/trunk
174
176
configfile: pyproject.toml
175
- plugins: flaky-3.8.1, xdist-3.5.0, hypothesis-6.99.6
176
- collected 1385 items / 1375 deselected / 10 selected
177
+ plugins: flaky-3.8.1, hypothesis-6.128.1, xdist-3.6.1
178
+ collected 1467 items / 1457 deselected / 10 selected
177
179
run-last-failure: no previously failed tests, not deselecting items.
178
180
179
181
tests/test_data.py::CoverageDataTest::test_add_to_hash_with_lines PASSED [ 10%]
@@ -187,11 +189,9 @@ can combine tox and pytest options::
187
189
tests/test_misc.py::HasherTest::test_dict_hashing PASSED [ 90%]
188
190
tests/test_misc.py::HasherTest::test_dict_collision PASSED [100%]
189
191
190
- ========================== 10 passed, 1375 deselected in 0.60s ===========================
191
- Skipping tests with Python tracer: Only one core: not running pytrace
192
- py310: OK (6.41 seconds)
193
- congratulations :) (6.72 seconds)
194
-
192
+ ============================= 10 passed, 1457 deselected in 3.13s =============================
193
+ py310: OK (16.62 seconds)
194
+ congratulations :) (16.97 seconds)
195
195
196
196
You can also affect the test runs with environment variables:
197
197
@@ -237,7 +237,8 @@ Other style questions are best answered by looking at the existing code.
237
237
Formatting of docstrings, comments, long lines, and so on, should match the
238
238
code that already exists.
239
239
240
- Many people love `black `_, but I would prefer not to run it on coverage.py.
240
+ Many people love auto-formatting with `black `_ or `ruff `_, but I would prefer
241
+ not to on coverage.py.
241
242
242
243
243
244
Continuous integration
@@ -299,6 +300,7 @@ fixes. If you need help writing tests, please ask.
299
300
.. _editorconfig.org : http://editorconfig.org
300
301
.. _tox : https://tox.readthedocs.io/
301
302
.. _black : https://pypi.org/project/black/
303
+ .. _ruff : https://pypi.org/project/ruff/
302
304
.. _set_env.py : https://nedbatchelder.com/blog/201907/set_envpy.html
303
305
.. _pytest test selectors : https://doc.pytest.org/en/stable/usage.html#specifying-which-tests-to-run
304
306
.. _sys.monitoring : https://docs.python.org/3/library/sys.monitoring.html
0 commit comments