D5150: tests: don't emit false failures when sqlite3 is missing

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Oct 18 11:50:43 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc3ad9ef0876c: tests: don't emit false failures when sqlite3 is missing (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5150?vs=12244&id=12246

REVISION DETAIL
  https://phab.mercurial-scm.org/D5150

AFFECTED FILES
  tests/test-duplicateoptions.py
  tests/test-storage.py

CHANGE DETAILS

diff --git a/tests/test-storage.py b/tests/test-storage.py
--- a/tests/test-storage.py
+++ b/tests/test-storage.py
@@ -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__)
diff --git a/tests/test-duplicateoptions.py b/tests/test-duplicateoptions.py
--- a/tests/test-duplicateoptions.py
+++ b/tests/test-duplicateoptions.py
@@ -8,6 +8,11 @@
 
 ignore = {b'highlight', b'win32text', b'factotum', b'beautifygraph'}
 
+try:
+    import sqlite3
+except ImportError:
+    ignore.add(b'sqlitestore')
+
 if os.name != 'nt':
     ignore.add(b'win32mbcs')
 



To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list