File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,14 @@ development at the same time, such as 4.5.x and 5.0.
20
20
Unreleased
21
21
----------
22
22
23
- Nothing yet.
23
+ - Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining
24
+ step could fail with ``assert row is not None `` using 7.0.2. This was due to
25
+ a race condition that has always been possible and is still possible. In
26
+ 7.0.1 and before, the error was silently swallowed by the combining code.
27
+ Now it will produce a message "Couldn't combine data file" and ignore the
28
+ data file as it used to do before 7.0.2. Closes `issue 1522 `_.
29
+
30
+ .. _issue 1522 : https://github.com/nedbat/coveragepy/issues/1522
24
31
25
32
26
33
.. _changes_7-0-2 :
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ def combine_parallel_data(
161
161
# The CoverageException has the file name in it, so just
162
162
# use the message as the warning.
163
163
data ._warn (str (exc ))
164
+ if message :
165
+ message (f"Couldn't combine data file { rel_file_name } : { exc } " )
164
166
delete_this_one = False
165
167
else :
166
168
data .update (new_data , aliases = aliases )
Original file line number Diff line number Diff line change @@ -289,6 +289,7 @@ def _read_db(self) -> None:
289
289
with self ._dbs [threading .get_ident ()] as db :
290
290
try :
291
291
row = db .execute_one ("select version from coverage_schema" )
292
+ assert row is not None
292
293
except Exception as exc :
293
294
if "no such table: coverage_schema" in str (exc ):
294
295
self ._init_db (db )
@@ -299,7 +300,6 @@ def _read_db(self) -> None:
299
300
)
300
301
) from exc
301
302
else :
302
- assert row is not None
303
303
schema_version = row [0 ]
304
304
if schema_version != SCHEMA_VERSION :
305
305
raise DataError (
You can’t perform that action at this time.
0 commit comments