tests: require SQLite 3.8.3+ as sqlitestore relies on "WITH" clause stable
authorYuya Nishihara <yuya@tcha.org>
Fri, 02 Nov 2018 21:25:35 +0900
branchstable
changeset 40427 1bf3e6041e2c
parent 40426 683e99f0b30c
child 40428 a91a2837150b
tests: require SQLite 3.8.3+ as sqlitestore relies on "WITH" clause The test fails on gcc112 because the SQLite is too old. https://sqlite.org/changes.html#version_3_8_3
tests/hghave.py
tests/test-storage.py
--- a/tests/hghave.py	Fri Oct 19 22:09:53 2018 +0800
+++ b/tests/hghave.py	Fri Nov 02 21:25:35 2018 +0900
@@ -791,10 +791,14 @@
 def has_sqlite():
     try:
         import sqlite3
-        sqlite3.sqlite_version
+        version = sqlite3.sqlite_version_info
     except ImportError:
         return False
 
+    if version < (3, 8, 3):
+        # WITH clause not supported
+        return False
+
     return matchoutput('sqlite3 -version', b'^3\.\d+')
 
 @check('vcr', 'vcr http mocking library')
--- a/tests/test-storage.py	Fri Oct 19 22:09:53 2018 +0800
+++ b/tests/test-storage.py	Fri Nov 02 21:25:35 2018 +0900
@@ -25,6 +25,14 @@
     sqlitestore = None
 
 try:
+    import sqlite3
+    if sqlite3.sqlite_version_info < (3, 8, 3):
+        # WITH clause not supported
+        sqlitestore = None
+except ImportError:
+    pass
+
+try:
     from mercurial import zstd
     zstd.__version__
 except ImportError: