pytest-cov
                                
                                 pytest-cov copied to clipboard
                                
                                    pytest-cov copied to clipboard
                            
                            
                            
                        locking the coverage file before use
Maybe, lock the coverage data file with something like https://pypi.org/project/filelock/ before reading/writing it? When using pytest-cov on Travis-CI with --cov-append, several jobs from the job matrix might be using the file concurrently.
Wouldn't the jobs run in separate containers/vms?
travis jobs run in separate containers/vm's
also note that coverage has a multi-process mode that works correct - its based on adding pids to coverage files and combining after runs, since anything else does not work without blocking
Using a distinct COVERAGE_FILE  per worker should help, see: https://github.com/nedbat/coveragepy/issues/883#issuecomment-650562896