| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2b50899 commit f85bce7
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -177,9 +177,9 @@ def CheckOpenUri(self): | |||
| 177 | 177 | with self.assertRaises(sqlite.OperationalError): | |
| 178 | 178 | cx.execute('insert into test(id) values(1)') | |
| 179 | 179 | ||
| 180 | + @unittest.skipIf(sqlite.sqlite_version_info >= (3, 3, 1), | ||
| 181 | + 'needs sqlite versions older than 3.3.1') | ||
| 180 | 182 | def CheckSameThreadErrorOnOldVersion(self): | |
| 181 | - if sqlite.sqlite_version_info >= (3, 3, 1): | ||
| 182 | - self.skipTest('test needs sqlite3 versions older than 3.3.1') | ||
| 183 | 183 | with self.assertRaises(sqlite.NotSupportedError) as cm: | |
| 184 | 184 | sqlite.connect(':memory:', check_same_thread=False) | |
| 185 | 185 | self.assertEqual(str(cm.exception), 'shared connections not available') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,9 +84,8 @@ def CheckStatementFinalizationOnCloseDb(self): | |||
| 84 | 84 | cur.execute("select 1 x union select " + str(i)) | |
| 85 | 85 | con.close() | |
| 86 | 86 | ||
| 87 | + @unittest.skipIf(sqlite.sqlite_version_info < (3, 2, 2), 'needs sqlite 3.2.2 or newer') | ||
| 87 | 88 | def CheckOnConflictRollback(self): | |
| 88 | - if sqlite.sqlite_version_info < (3, 2, 2): | ||
| 89 | - return | ||
| 90 | 89 | con = sqlite.connect(":memory:") | |
| 91 | 90 | con.execute("create table foo(x, unique(x) on conflict rollback)") | |
| 92 | 91 | con.execute("insert into foo(x) values (1)") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -111,25 +111,21 @@ def CheckToggleAutoCommit(self): | |||
| 111 | 111 | res = self.cur2.fetchall() | |
| 112 | 112 | self.assertEqual(len(res), 1) | |
| 113 | 113 | ||
| 114 | + @unittest.skipIf(sqlite.sqlite_version_info < (3, 2, 2), | ||
| 115 | + 'test hangs on sqlite versions older than 3.2.2') | ||
| 114 | 116 | def CheckRaiseTimeout(self): | |
| 115 | - if sqlite.sqlite_version_info < (3, 2, 2): | ||
| 116 | - # This will fail (hang) on earlier versions of sqlite. | ||
| 117 | - # Determine exact version it was fixed. 3.2.1 hangs. | ||
| 118 | - return | ||
| 119 | 117 | self.cur1.execute("create table test(i)") | |
| 120 | 118 | self.cur1.execute("insert into test(i) values (5)") | |
| 121 | 119 | with self.assertRaises(sqlite.OperationalError): | |
| 122 | 120 | self.cur2.execute("insert into test(i) values (5)") | |
| 123 | 121 | ||
| 122 | + @unittest.skipIf(sqlite.sqlite_version_info < (3, 2, 2), | ||
| 123 | + 'test hangs on sqlite versions older than 3.2.2') | ||
| 124 | 124 | def CheckLocking(self): | |
| 125 | 125 | """ | |
| 126 | 126 | This tests the improved concurrency with pysqlite 2.3.4. You needed | |
| 127 | 127 | to roll back con2 before you could commit con1. | |
| 128 | 128 | """ | |
| 129 | - if sqlite.sqlite_version_info < (3, 2, 2): | ||
| 130 | - # This will fail (hang) on earlier versions of sqlite. | ||
| 131 | - # Determine exact version it was fixed. 3.2.1 hangs. | ||
| 132 | - return | ||
| 133 | 129 | self.cur1.execute("create table test(i)") | |
| 134 | 130 | self.cur1.execute("insert into test(i) values (5)") | |
| 135 | 131 | with self.assertRaises(sqlite.OperationalError): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -340,11 +340,9 @@ def CheckSqliteTimestamp(self): | |||
| 340 | 340 | ts2 = self.cur.fetchone()[0] | |
| 341 | 341 | self.assertEqual(ts, ts2) | |
| 342 | 342 | ||
| 343 | + @unittest.skipIf(sqlite.sqlite_version_info < (3, 1), | ||
| 344 | + 'the date functions are available on 3.1 or later') | ||
| 343 | 345 | def CheckSqlTimestamp(self): | |
| 344 | - # The date functions are only available in SQLite version 3.1 or later | ||
| 345 | - if sqlite.sqlite_version_info < (3, 1): | ||
| 346 | - return | ||
| 347 | - | ||
| 348 | 346 | # SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time. | |
| 349 | 347 | now = datetime.datetime.now() | |
| 350 | 348 | self.cur.execute("insert into test(ts) values (current_timestamp)") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments