-
-
Notifications
You must be signed in to change notification settings - Fork 478
Error from sqlite3 initialising sqlite. #1646
Description
Describe the bug
When running coverage.
I get Couldn't use data file '/home/mbell/projects/api-aac/.coverage': Safety level may not be changed inside a transaction
This is because for certain builds of sqlite3 synchronous
To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
- What version of Python are you using?
3.10.4 - What version of coverage.py shows the problem? The output of
coverage debug sysis helpful.
coverage==7.2.1 - What versions of what packages do you have installed? The output of
pip freezeis helpful.
pytest==7.3.2
pytest-cov==4.1.0 - What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
The problem is there is not exactly any visible code, this issue occurs when running:
coverage jsonorpytest --json-report --json-report-file nosetests.json --cov tests/ tests/
The reason this is occurring because of differences in the_sqlite3.sofile even if the same version of sqlite3.
If I runPYTHONPATH=. coverage json --debug=sql
The out put is
Connecting to '/home/mbell/projects/api-aac/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
EXCEPTION from execute: Safety level may not be changed inside a transaction
Couldn't use data file '/home/mbell/projects/api-aac/.coverage': Safety level may not be changed inside a transaction
If I change the installed libraries to run pragma synchronous=off before pragma journal_mode=off. Then everything works successfully
- What commands should we run to reproduce the problem? Be specific. Include everything, even
git clone,pip install, and so on. Explain like we're five!
On Linux:
Get a version of a_sqlite3.sofile and put it in a root directory of the project.
Make sure coverage is installedpip install coverage
Runcoverage json
Expected behavior
A clear and concise description of what you expected to happen.
Run coverage without sqlite triggered error.
Additional context
Using the _sqlite3.so binary directly as it has been taken from an appropriate environment to be used inside aws lambda for python3.10