Skip to content

Commit b221fb1

Browse files
committed
Add reproducer for #693.
1 parent 2ce6b0b commit b221fb1

File tree

3 files changed

+195
-43
lines changed

3 files changed

+195
-43
lines changed

.github/workflows/test.yml

Lines changed: 168 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,131 +60,257 @@ jobs:
6060
toxpython: 'python3.11'
6161
tox_env: 'docs'
6262
os: 'ubuntu-latest'
63-
- name: 'py39-pytest83-xdist36-coverage77 (ubuntu)'
63+
- name: 'py39-pytest83-xdist36-coverage78 (ubuntu)'
6464
python: '3.9'
6565
toxpython: 'python3.9'
6666
python_arch: 'x64'
67-
tox_env: 'py39-pytest83-xdist36-coverage77'
67+
tox_env: 'py39-pytest83-xdist36-coverage78'
6868
os: 'ubuntu-latest'
69-
- name: 'py39-pytest83-xdist36-coverage77 (windows)'
69+
- name: 'py39-pytest83-xdist36-coverage78 (windows)'
7070
python: '3.9'
7171
toxpython: 'python3.9'
7272
python_arch: 'x64'
73-
tox_env: 'py39-pytest83-xdist36-coverage77'
73+
tox_env: 'py39-pytest83-xdist36-coverage78'
7474
os: 'windows-latest'
75-
- name: 'py39-pytest83-xdist36-coverage77 (macos)'
75+
- name: 'py39-pytest83-xdist36-coverage78 (macos)'
7676
python: '3.9'
7777
toxpython: 'python3.9'
7878
python_arch: 'arm64'
79-
tox_env: 'py39-pytest83-xdist36-coverage77'
79+
tox_env: 'py39-pytest83-xdist36-coverage78'
8080
os: 'macos-latest'
81-
- name: 'py310-pytest83-xdist36-coverage77 (ubuntu)'
81+
- name: 'py39-pytest84-xdist36-coverage78 (ubuntu)'
82+
python: '3.9'
83+
toxpython: 'python3.9'
84+
python_arch: 'x64'
85+
tox_env: 'py39-pytest84-xdist36-coverage78'
86+
os: 'ubuntu-latest'
87+
- name: 'py39-pytest84-xdist36-coverage78 (windows)'
88+
python: '3.9'
89+
toxpython: 'python3.9'
90+
python_arch: 'x64'
91+
tox_env: 'py39-pytest84-xdist36-coverage78'
92+
os: 'windows-latest'
93+
- name: 'py39-pytest84-xdist36-coverage78 (macos)'
94+
python: '3.9'
95+
toxpython: 'python3.9'
96+
python_arch: 'arm64'
97+
tox_env: 'py39-pytest84-xdist36-coverage78'
98+
os: 'macos-latest'
99+
- name: 'py310-pytest83-xdist36-coverage78 (ubuntu)'
100+
python: '3.10'
101+
toxpython: 'python3.10'
102+
python_arch: 'x64'
103+
tox_env: 'py310-pytest83-xdist36-coverage78'
104+
os: 'ubuntu-latest'
105+
- name: 'py310-pytest83-xdist36-coverage78 (windows)'
106+
python: '3.10'
107+
toxpython: 'python3.10'
108+
python_arch: 'x64'
109+
tox_env: 'py310-pytest83-xdist36-coverage78'
110+
os: 'windows-latest'
111+
- name: 'py310-pytest83-xdist36-coverage78 (macos)'
112+
python: '3.10'
113+
toxpython: 'python3.10'
114+
python_arch: 'arm64'
115+
tox_env: 'py310-pytest83-xdist36-coverage78'
116+
os: 'macos-latest'
117+
- name: 'py310-pytest84-xdist36-coverage78 (ubuntu)'
82118
python: '3.10'
83119
toxpython: 'python3.10'
84120
python_arch: 'x64'
85-
tox_env: 'py310-pytest83-xdist36-coverage77'
121+
tox_env: 'py310-pytest84-xdist36-coverage78'
86122
os: 'ubuntu-latest'
87-
- name: 'py310-pytest83-xdist36-coverage77 (windows)'
123+
- name: 'py310-pytest84-xdist36-coverage78 (windows)'
88124
python: '3.10'
89125
toxpython: 'python3.10'
90126
python_arch: 'x64'
91-
tox_env: 'py310-pytest83-xdist36-coverage77'
127+
tox_env: 'py310-pytest84-xdist36-coverage78'
92128
os: 'windows-latest'
93-
- name: 'py310-pytest83-xdist36-coverage77 (macos)'
129+
- name: 'py310-pytest84-xdist36-coverage78 (macos)'
94130
python: '3.10'
95131
toxpython: 'python3.10'
96132
python_arch: 'arm64'
97-
tox_env: 'py310-pytest83-xdist36-coverage77'
133+
tox_env: 'py310-pytest84-xdist36-coverage78'
98134
os: 'macos-latest'
99-
- name: 'py311-pytest83-xdist36-coverage77 (ubuntu)'
135+
- name: 'py311-pytest83-xdist36-coverage78 (ubuntu)'
100136
python: '3.11'
101137
toxpython: 'python3.11'
102138
python_arch: 'x64'
103-
tox_env: 'py311-pytest83-xdist36-coverage77'
139+
tox_env: 'py311-pytest83-xdist36-coverage78'
104140
os: 'ubuntu-latest'
105-
- name: 'py311-pytest83-xdist36-coverage77 (windows)'
141+
- name: 'py311-pytest83-xdist36-coverage78 (windows)'
106142
python: '3.11'
107143
toxpython: 'python3.11'
108144
python_arch: 'x64'
109-
tox_env: 'py311-pytest83-xdist36-coverage77'
145+
tox_env: 'py311-pytest83-xdist36-coverage78'
110146
os: 'windows-latest'
111-
- name: 'py311-pytest83-xdist36-coverage77 (macos)'
147+
- name: 'py311-pytest83-xdist36-coverage78 (macos)'
148+
python: '3.11'
149+
toxpython: 'python3.11'
150+
python_arch: 'arm64'
151+
tox_env: 'py311-pytest83-xdist36-coverage78'
152+
os: 'macos-latest'
153+
- name: 'py311-pytest84-xdist36-coverage78 (ubuntu)'
154+
python: '3.11'
155+
toxpython: 'python3.11'
156+
python_arch: 'x64'
157+
tox_env: 'py311-pytest84-xdist36-coverage78'
158+
os: 'ubuntu-latest'
159+
- name: 'py311-pytest84-xdist36-coverage78 (windows)'
112160
python: '3.11'
113161
toxpython: 'python3.11'
162+
python_arch: 'x64'
163+
tox_env: 'py311-pytest84-xdist36-coverage78'
164+
os: 'windows-latest'
165+
- name: 'py311-pytest84-xdist36-coverage78 (macos)'
166+
python: '3.11'
167+
toxpython: 'python3.11'
168+
python_arch: 'arm64'
169+
tox_env: 'py311-pytest84-xdist36-coverage78'
170+
os: 'macos-latest'
171+
- name: 'py312-pytest83-xdist36-coverage78 (ubuntu)'
172+
python: '3.12'
173+
toxpython: 'python3.12'
174+
python_arch: 'x64'
175+
tox_env: 'py312-pytest83-xdist36-coverage78'
176+
os: 'ubuntu-latest'
177+
- name: 'py312-pytest83-xdist36-coverage78 (windows)'
178+
python: '3.12'
179+
toxpython: 'python3.12'
180+
python_arch: 'x64'
181+
tox_env: 'py312-pytest83-xdist36-coverage78'
182+
os: 'windows-latest'
183+
- name: 'py312-pytest83-xdist36-coverage78 (macos)'
184+
python: '3.12'
185+
toxpython: 'python3.12'
114186
python_arch: 'arm64'
115-
tox_env: 'py311-pytest83-xdist36-coverage77'
187+
tox_env: 'py312-pytest83-xdist36-coverage78'
116188
os: 'macos-latest'
117-
- name: 'py312-pytest83-xdist36-coverage77 (ubuntu)'
189+
- name: 'py312-pytest84-xdist36-coverage78 (ubuntu)'
118190
python: '3.12'
119191
toxpython: 'python3.12'
120192
python_arch: 'x64'
121-
tox_env: 'py312-pytest83-xdist36-coverage77'
193+
tox_env: 'py312-pytest84-xdist36-coverage78'
122194
os: 'ubuntu-latest'
123-
- name: 'py312-pytest83-xdist36-coverage77 (windows)'
195+
- name: 'py312-pytest84-xdist36-coverage78 (windows)'
124196
python: '3.12'
125197
toxpython: 'python3.12'
126198
python_arch: 'x64'
127-
tox_env: 'py312-pytest83-xdist36-coverage77'
199+
tox_env: 'py312-pytest84-xdist36-coverage78'
128200
os: 'windows-latest'
129-
- name: 'py312-pytest83-xdist36-coverage77 (macos)'
201+
- name: 'py312-pytest84-xdist36-coverage78 (macos)'
130202
python: '3.12'
131203
toxpython: 'python3.12'
132204
python_arch: 'arm64'
133-
tox_env: 'py312-pytest83-xdist36-coverage77'
205+
tox_env: 'py312-pytest84-xdist36-coverage78'
134206
os: 'macos-latest'
135-
- name: 'py313-pytest83-xdist36-coverage77 (ubuntu)'
207+
- name: 'py313-pytest83-xdist36-coverage78 (ubuntu)'
136208
python: '3.13'
137209
toxpython: 'python3.13'
138210
python_arch: 'x64'
139-
tox_env: 'py313-pytest83-xdist36-coverage77'
211+
tox_env: 'py313-pytest83-xdist36-coverage78'
140212
os: 'ubuntu-latest'
141-
- name: 'py313-pytest83-xdist36-coverage77 (windows)'
213+
- name: 'py313-pytest83-xdist36-coverage78 (windows)'
142214
python: '3.13'
143215
toxpython: 'python3.13'
144216
python_arch: 'x64'
145-
tox_env: 'py313-pytest83-xdist36-coverage77'
217+
tox_env: 'py313-pytest83-xdist36-coverage78'
146218
os: 'windows-latest'
147-
- name: 'py313-pytest83-xdist36-coverage77 (macos)'
219+
- name: 'py313-pytest83-xdist36-coverage78 (macos)'
148220
python: '3.13'
149221
toxpython: 'python3.13'
150222
python_arch: 'arm64'
151-
tox_env: 'py313-pytest83-xdist36-coverage77'
223+
tox_env: 'py313-pytest83-xdist36-coverage78'
224+
os: 'macos-latest'
225+
- name: 'py313-pytest84-xdist36-coverage78 (ubuntu)'
226+
python: '3.13'
227+
toxpython: 'python3.13'
228+
python_arch: 'x64'
229+
tox_env: 'py313-pytest84-xdist36-coverage78'
230+
os: 'ubuntu-latest'
231+
- name: 'py313-pytest84-xdist36-coverage78 (windows)'
232+
python: '3.13'
233+
toxpython: 'python3.13'
234+
python_arch: 'x64'
235+
tox_env: 'py313-pytest84-xdist36-coverage78'
236+
os: 'windows-latest'
237+
- name: 'py313-pytest84-xdist36-coverage78 (macos)'
238+
python: '3.13'
239+
toxpython: 'python3.13'
240+
python_arch: 'arm64'
241+
tox_env: 'py313-pytest84-xdist36-coverage78'
242+
os: 'macos-latest'
243+
- name: 'pypy39-pytest83-xdist36-coverage78 (ubuntu)'
244+
python: 'pypy-3.9'
245+
toxpython: 'pypy3.9'
246+
python_arch: 'x64'
247+
tox_env: 'pypy39-pytest83-xdist36-coverage78'
248+
os: 'ubuntu-latest'
249+
- name: 'pypy39-pytest83-xdist36-coverage78 (windows)'
250+
python: 'pypy-3.9'
251+
toxpython: 'pypy3.9'
252+
python_arch: 'x64'
253+
tox_env: 'pypy39-pytest83-xdist36-coverage78'
254+
os: 'windows-latest'
255+
- name: 'pypy39-pytest83-xdist36-coverage78 (macos)'
256+
python: 'pypy-3.9'
257+
toxpython: 'pypy3.9'
258+
python_arch: 'arm64'
259+
tox_env: 'pypy39-pytest83-xdist36-coverage78'
152260
os: 'macos-latest'
153-
- name: 'pypy39-pytest83-xdist36-coverage77 (ubuntu)'
261+
- name: 'pypy39-pytest84-xdist36-coverage78 (ubuntu)'
154262
python: 'pypy-3.9'
155263
toxpython: 'pypy3.9'
156264
python_arch: 'x64'
157-
tox_env: 'pypy39-pytest83-xdist36-coverage77'
265+
tox_env: 'pypy39-pytest84-xdist36-coverage78'
158266
os: 'ubuntu-latest'
159-
- name: 'pypy39-pytest83-xdist36-coverage77 (windows)'
267+
- name: 'pypy39-pytest84-xdist36-coverage78 (windows)'
160268
python: 'pypy-3.9'
161269
toxpython: 'pypy3.9'
162270
python_arch: 'x64'
163-
tox_env: 'pypy39-pytest83-xdist36-coverage77'
271+
tox_env: 'pypy39-pytest84-xdist36-coverage78'
164272
os: 'windows-latest'
165-
- name: 'pypy39-pytest83-xdist36-coverage77 (macos)'
273+
- name: 'pypy39-pytest84-xdist36-coverage78 (macos)'
166274
python: 'pypy-3.9'
167275
toxpython: 'pypy3.9'
168276
python_arch: 'arm64'
169-
tox_env: 'pypy39-pytest83-xdist36-coverage77'
277+
tox_env: 'pypy39-pytest84-xdist36-coverage78'
278+
os: 'macos-latest'
279+
- name: 'pypy310-pytest83-xdist36-coverage78 (ubuntu)'
280+
python: 'pypy-3.10'
281+
toxpython: 'pypy3.10'
282+
python_arch: 'x64'
283+
tox_env: 'pypy310-pytest83-xdist36-coverage78'
284+
os: 'ubuntu-latest'
285+
- name: 'pypy310-pytest83-xdist36-coverage78 (windows)'
286+
python: 'pypy-3.10'
287+
toxpython: 'pypy3.10'
288+
python_arch: 'x64'
289+
tox_env: 'pypy310-pytest83-xdist36-coverage78'
290+
os: 'windows-latest'
291+
- name: 'pypy310-pytest83-xdist36-coverage78 (macos)'
292+
python: 'pypy-3.10'
293+
toxpython: 'pypy3.10'
294+
python_arch: 'arm64'
295+
tox_env: 'pypy310-pytest83-xdist36-coverage78'
170296
os: 'macos-latest'
171-
- name: 'pypy310-pytest83-xdist36-coverage77 (ubuntu)'
297+
- name: 'pypy310-pytest84-xdist36-coverage78 (ubuntu)'
172298
python: 'pypy-3.10'
173299
toxpython: 'pypy3.10'
174300
python_arch: 'x64'
175-
tox_env: 'pypy310-pytest83-xdist36-coverage77'
301+
tox_env: 'pypy310-pytest84-xdist36-coverage78'
176302
os: 'ubuntu-latest'
177-
- name: 'pypy310-pytest83-xdist36-coverage77 (windows)'
303+
- name: 'pypy310-pytest84-xdist36-coverage78 (windows)'
178304
python: 'pypy-3.10'
179305
toxpython: 'pypy3.10'
180306
python_arch: 'x64'
181-
tox_env: 'pypy310-pytest83-xdist36-coverage77'
307+
tox_env: 'pypy310-pytest84-xdist36-coverage78'
182308
os: 'windows-latest'
183-
- name: 'pypy310-pytest83-xdist36-coverage77 (macos)'
309+
- name: 'pypy310-pytest84-xdist36-coverage78 (macos)'
184310
python: 'pypy-3.10'
185311
toxpython: 'pypy3.10'
186312
python_arch: 'arm64'
187-
tox_env: 'pypy310-pytest83-xdist36-coverage77'
313+
tox_env: 'pypy310-pytest84-xdist36-coverage78'
188314
os: 'macos-latest'
189315
steps:
190316
- uses: actions/checkout@v4

tests/test_pytest_cov.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,30 @@ def test_cover_conftest(testdir):
13431343
result.stdout.fnmatch_lines([CONF_RESULT])
13441344

13451345

1346+
def test_filterwarnings_error(testdir):
1347+
testdir.makeini(r"""
1348+
[pytest]
1349+
filterwarnings =
1350+
error
1351+
# to make this pass add this:
1352+
# once::coverage.exceptions.CoverageWarning
1353+
# once::pytest_cov.CovReportWarning
1354+
""")
1355+
testdir.makepyfile(mod=MODULE)
1356+
testdir.makepyfile(plug=CONFTEST)
1357+
script = testdir.makepyfile(BASIC_TEST)
1358+
result = testdir.runpytest('-v', '--cov=mod', '--cov-report=term-missing', '-p', 'plug', script)
1359+
assert result.ret == 0
1360+
result.stdout.fnmatch_lines(['* 1 passed *'])
1361+
result.stderr.fnmatch_lines(
1362+
[
1363+
'* (module-not-measured)',
1364+
'* (no-data-collected)',
1365+
'* CovReportWarning: Failed to generate report: No data to report.',
1366+
]
1367+
)
1368+
1369+
13461370
@pytest.mark.skipif('sys.platform == "win32" and platform.python_implementation() == "PyPy"')
13471371
def test_cover_looponfail(testdir, monkeypatch):
13481372
testdir.makepyfile(mod=MODULE)

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ envlist =
1414
clean,
1515
check,
1616
docs,
17-
{py39,py310,py311,py312,py313,pypy39,pypy310}-{pytest83}-{xdist36}-{coverage77},
17+
{py39,py310,py311,py312,py313,pypy39,pypy310}-{pytest83,pytest84}-{xdist36}-{coverage78},
1818
report
1919
ignore_basepython_conflict = true
2020

@@ -40,6 +40,7 @@ setenv =
4040
pytest81: _DEP_PYTEST=pytest==8.1.1
4141
pytest82: _DEP_PYTEST=pytest==8.2.2
4242
pytest83: _DEP_PYTEST=pytest==8.3.5
43+
pytest84: _DEP_PYTEST=pytest==8.4.0
4344

4445
xdist32: _DEP_PYTESTXDIST=pytest-xdist==3.2.0
4546
xdist33: _DEP_PYTESTXDIST=pytest-xdist==3.3.1
@@ -54,6 +55,7 @@ setenv =
5455
coverage75: _DEP_COVERAGE=coverage==7.5.4
5556
coverage76: _DEP_COVERAGE=coverage==7.6.12
5657
coverage77: _DEP_COVERAGE=coverage==7.7.1
58+
coverage77: _DEP_COVERAGE=coverage==7.8.2
5759
# For testing against a coverage.py working tree.
5860
coveragedev: _DEP_COVERAGE=-e{env:COVERAGE_HOME}
5961
passenv =

0 commit comments

Comments
 (0)