Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f79f2cc

Browse files
committedJan 31, 2020
removed CTE test from MySQL for < MySQL 8.0
1 parent a130c1b commit f79f2cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎tests/sql.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ def test_rollback(self):
128128
self.db.execute("ROLLBACK")
129129
self.assertEqual(self.db.execute("SELECT val FROM cs50"), [])
130130

131-
def test_cte(self):
132-
self.assertEqual(self.db.execute("WITH foo AS ( SELECT 1 ) SELECT * FROM foo"), [{"1": 1}])
133-
134131
def tearDown(self):
135132
self.db.execute("DROP TABLE cs50")
136133
self.db.execute("DROP TABLE IF EXISTS foo")
@@ -161,6 +158,9 @@ def setUpClass(self):
161158
def setUp(self):
162159
self.db.execute("CREATE TABLE cs50 (id SERIAL PRIMARY KEY, val VARCHAR(16), bin BYTEA)")
163160

161+
def test_cte(self):
162+
self.assertEqual(self.db.execute("WITH foo AS ( SELECT 1 AS bar ) SELECT bar FROM foo"), [{"bar": 1}])
163+
164164
class SQLiteTests(SQLTests):
165165
@classmethod
166166
def setUpClass(self):
@@ -309,6 +309,9 @@ def test_numeric(self):
309309
self.assertRaises(RuntimeError, self.db.execute, "INSERT INTO foo VALUES (:1, :2)", 'bar', 'baz', 'qux')
310310
self.assertRaises(RuntimeError, self.db.execute, "INSERT INTO foo VALUES (:1, :2)", 'bar', baz='baz')
311311

312+
def test_cte(self):
313+
self.assertEqual(self.db.execute("WITH foo AS ( SELECT 1 AS bar ) SELECT bar FROM foo"), [{"bar": 1}])
314+
312315

313316
if __name__ == "__main__":
314317
suite = unittest.TestSuite([

0 commit comments

Comments
 (0)
Please sign in to comment.