|
23 | 23 | import os, unittest
|
24 | 24 | import sqlite3 as sqlite
|
25 | 25 |
|
26 |
| -from test.support import LOOPBACK_TIMEOUT |
27 | 26 | from test.support.os_helper import TESTFN, unlink
|
28 | 27 |
|
29 | 28 | from test.test_sqlite3.test_dbapi import memory_database
|
30 | 29 |
|
31 | 30 |
|
32 |
| -TIMEOUT = LOOPBACK_TIMEOUT / 10 |
33 |
| - |
34 |
| - |
35 | 31 | class TransactionTests(unittest.TestCase):
|
36 | 32 | def setUp(self):
|
37 |
| - self.con1 = sqlite.connect(TESTFN, timeout=TIMEOUT) |
| 33 | + # We can disable the busy handlers, since we control |
| 34 | + # the order of SQLite C API operations. |
| 35 | + self.con1 = sqlite.connect(TESTFN, timeout=0) |
38 | 36 | self.cur1 = self.con1.cursor()
|
39 | 37 |
|
40 |
| - self.con2 = sqlite.connect(TESTFN, timeout=TIMEOUT) |
| 38 | + self.con2 = sqlite.connect(TESTFN, timeout=0) |
41 | 39 | self.cur2 = self.con2.cursor()
|
42 | 40 |
|
43 | 41 | def tearDown(self):
|
@@ -117,10 +115,8 @@ def test_raise_timeout(self):
|
117 | 115 | self.cur2.execute("insert into test(i) values (5)")
|
118 | 116 |
|
119 | 117 | def test_locking(self):
|
120 |
| - """ |
121 |
| - This tests the improved concurrency with pysqlite 2.3.4. You needed |
122 |
| - to roll back con2 before you could commit con1. |
123 |
| - """ |
| 118 | + # This tests the improved concurrency with pysqlite 2.3.4. You needed |
| 119 | + # to roll back con2 before you could commit con1. |
124 | 120 | self.cur1.execute("create table test(i)")
|
125 | 121 | self.cur1.execute("insert into test(i) values (5)")
|
126 | 122 | with self.assertRaises(sqlite.OperationalError):
|
|
0 commit comments