diff tests/test-storage.py @ 40363:c3ad9ef0876c

tests: don't emit false failures when sqlite3 is missing I'm honestly surprised we have buildbot coverage for this, but we do! Differential Revision: https://phab.mercurial-scm.org/D5150
author Augie Fackler <augie@google.com>
date Thu, 18 Oct 2018 11:14:04 -0400
parents fed697fa1734
children 1bf3e6041e2c
line wrap: on
line diff
--- a/tests/test-storage.py	Tue Oct 16 08:48:23 2018 +0200
+++ b/tests/test-storage.py	Thu Oct 18 11:14:04 2018 -0400
@@ -17,9 +17,12 @@
     storage as storagetesting,
 )
 
-from hgext import (
-    sqlitestore,
-)
+try:
+    from hgext import (
+        sqlitestore,
+    )
+except ImportError:
+    sqlitestore = None
 
 try:
     from mercurial import zstd
@@ -110,12 +113,13 @@
     else:
         raise error.Abort(b'must supply rawtext or delta arguments')
 
-sqlitefileindextests = storagetesting.makeifileindextests(
-    makesqlitefile, maketransaction, addrawrevisionsqlite)
-sqlitefiledatatests = storagetesting.makeifiledatatests(
-    makesqlitefile, maketransaction, addrawrevisionsqlite)
-sqlitefilemutationtests = storagetesting.makeifilemutationtests(
-    makesqlitefile, maketransaction, addrawrevisionsqlite)
+if sqlitestore is not None:
+    sqlitefileindextests = storagetesting.makeifileindextests(
+        makesqlitefile, maketransaction, addrawrevisionsqlite)
+    sqlitefiledatatests = storagetesting.makeifiledatatests(
+        makesqlitefile, maketransaction, addrawrevisionsqlite)
+    sqlitefilemutationtests = storagetesting.makeifilemutationtests(
+        makesqlitefile, maketransaction, addrawrevisionsqlite)
 
 if __name__ == '__main__':
     silenttestrunner.main(__name__)