File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 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.
2020 Unreleased
2121----------
2222
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
2431
2532
2633.. _changes_7-0-2 :
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ def combine_parallel_data(
161161 # The CoverageException has the file name in it, so just
162162 # use the message as the warning.
163163 data ._warn (str (exc ))
164+ if message :
165+ message (f"Couldn't combine data file { rel_file_name } : { exc } " )
164166 delete_this_one = False
165167 else :
166168 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:
289289 with self ._dbs [threading .get_ident ()] as db :
290290 try :
291291 row = db .execute_one ("select version from coverage_schema" )
292+ assert row is not None
292293 except Exception as exc :
293294 if "no such table: coverage_schema" in str (exc ):
294295 self ._init_db (db )
@@ -299,7 +300,6 @@ def _read_db(self) -> None:
299300 )
300301 ) from exc
301302 else :
302- assert row is not None
303303 schema_version = row [0 ]
304304 if schema_version != SCHEMA_VERSION :
305305 raise DataError (
You can’t perform that action at this time.
0 commit comments