[PATCH logilab-database] [test] Mark test_only_one_lazy_module_initialization as expected failure

Denis Laxalde denis.laxalde at logilab.fr
Tue Jun 5 11:52:52 CEST 2018

# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1528192056 -7200
#      Tue Jun 05 11:47:36 2018 +0200
# Node ID 725c5dbb7ec89a7b547edcdb322f20f0736e1ad2
# Parent  0cb8c5caeb17dc7f157da30650af74bdd98bec3e
# Available At https://hg.logilab.org/review/logilab/database
#              hg pull https://hg.logilab.org/review/logilab/database -r 725c5dbb7ec8
# EXP-Topic py3
[test] Mark test_only_one_lazy_module_initialization as expected failure

When all tests are run together, the "sqlite" adapter may have already
been initialized by another test. So
test_only_one_lazy_module_initialization will break on its first
assertion. Following review discussion, there appears to be no simple
way to handle this so we mark the test as expected failure so that it
does not break in CI environment (or tox) but it might still succeed
when unittest_sqlite.py is run independently.

diff --git a/test/unittest_sqlite.py b/test/unittest_sqlite.py
--- a/test/unittest_sqlite.py
+++ b/test/unittest_sqlite.py
@@ -43,6 +43,7 @@ class SQLiteHelperTC(unittest.TestCase):
 class SQLiteAdapterTC(unittest.TestCase):
+    @unittest.expectedFailure
     def test_only_one_lazy_module_initialization(self):
         adapter = lgdbsqlite._Sqlite3Adapter(sqlite3)

More information about the cubicweb-devel mailing list