We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bf2b5c commit 8f782b0Copy full SHA for 8f782b0
tests/db.py
@@ -6,7 +6,6 @@
6
import psycopg2
7
import random
8
import re
9
-import shutil
10
import signal
11
import sqlite3
12
import string
@@ -24,13 +23,12 @@ def get_dsn(self):
24
23
return None
25
26
def query(self, query):
27
- orig = os.path.join(self.path)
28
- copy = self.path + ".copy"
29
- shutil.copyfile(orig, copy)
30
- db = sqlite3.connect(copy)
+ db = sqlite3.connect(self.path)
31
32
db.row_factory = sqlite3.Row
33
c = db.cursor()
+ # Don't get upset by concurrent writes; wait for up to 5 seconds!
+ c.execute("PRAGMA busy_timeout = 5000")
34
c.execute(query)
35
rows = c.fetchall()
36
0 commit comments