summaryrefslogtreecommitdiff
path: root/coverage/sqldata.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-19 07:47:54 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-24 06:54:17 -0400
commit948c307c89c9f61256bd96b770fa5b14ee4fe383 (patch)
treed17aa0456cf4e39fd6daff3c0a33fa52581cb695 /coverage/sqldata.py
parentb282c54ebaaae13aa8b81f2380cdc20acaa9fc69 (diff)
downloadpython-coveragepy-git-948c307c89c9f61256bd96b770fa5b14ee4fe383.tar.gz
PyPy needs to close cursors from pragmas
Diffstat (limited to 'coverage/sqldata.py')
-rw-r--r--coverage/sqldata.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/coverage/sqldata.py b/coverage/sqldata.py
index f53561e7..f92e245b 100644
--- a/coverage/sqldata.py
+++ b/coverage/sqldata.py
@@ -3,6 +3,7 @@
"""Sqlite coverage data."""
+# TODO: get sys_info for data class, so we can see sqlite version etc
# TODO: get rid of skip_unless_data_storage_is_json
# TODO: get rid of "JSON message" and "SQL message" in the tests
# TODO: check the schema
@@ -403,9 +404,11 @@ class Sqlite(SimpleRepr):
self.con = sqlite3.connect(self.filename)
# This pragma makes writing faster. It disables rollbacks, but we never need them.
- self.execute("pragma journal_mode=off")
+ # PyPy needs the .close() calls here, or sqlite gets twisted up:
+ # https://bitbucket.org/pypy/pypy/issues/2872/default-isolation-mode-is-different-on
+ self.execute("pragma journal_mode=off").close()
# This pragma makes writing faster.
- self.execute("pragma synchronous=off")
+ self.execute("pragma synchronous=off").close()
def close(self):
self.con.close()