question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

coverage.misc.CoverageException: Couldn't use data file: Safety level may not be changed inside a transaction

See original GitHub issue

Hello and thank you for your work on this project.

A possible incompatibility between pytest-cov and coverage versions greater than 5.0.0 is causing tests to fail in my company’s projects. To resolve this problem, our team has pinned coverage to version 4.4 in test-requirements.txt.

After cloning this repo, I noticed that tests are failing when I run them locally and the coverage50 env is set. Have you witnessed this error before and is it possible that coverage ought to be pinned down to < 5.0.0 in the requirements file here?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
patti-ccommented, Jan 8, 2020

@nedbat - Thank you for your response! The command I ran that fails is tox -e py3-pytest52-xdist30-coverage50 on master in pytest-cov. When I run these tests, I see the same error on each failed test that I see in my own projects when attepting to run tox, which is to say:

E           and: 'INTERNALERROR>   File "/Users/patriciacarter/development/pytest-cov/.tox/py3-pytest52-xdist30-coverage50/lib/python3.6/site-packages/coverage/sqldata.py", line 1025, in execute'
E           and: 'INTERNALERROR>     return self.con.execute(sql, parameters)'
E           and: 'INTERNALERROR> sqlite3.OperationalError: Safety level may not be changed inside a transaction'
1reaction
nedbatcommented, Jan 8, 2020

@patti-c Coverage 5.0 is new, and we are working out the problems. We are not going to pin coverage in pytest-cov, instead we will be trying to fix the problems in coverage.

Can you give us instructions for reproducing the problem? What repo are you running, at which commit, and what commands are you running to see the problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

coverage.misc.CoverageException: Couldn't use data file ...
coverage.misc.CoverageException: Couldn't use data file: Safety level may not be changed inside a transaction #404.
Read more >
python - Pytest coverage.py errror - Stack Overflow
I unit testing python code and running command pytest --cov , test is running fine but coverage is not ...
Read more >
Change history for coverage.py - Read the Docs
Fix: the coverage data file is now created in a more robust way, ... In 6.0, the coverage.py exceptions moved from coverage.misc to...
Read more >
pytest-cov - PyPI
Pytest plugin for measuring coverage. ... The data file is left at the end of testing so that it is possible to use...
Read more >
2022 Publication 17 - IRS
situation and is not intended to replace the law or change ... Health coverage tax credit is not ... get a social security...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found