From 01b83595d59b929de873bbd5d396d86a9b35aeda Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Fri, 16 Dec 2016 11:28:25 +0100 Subject: [PATCH] Fix test when running with SQLite 3.7.17 from CentOS 7 https://review.openstack.org/348943 introduced a test that fails to run in SQLite 3.7.17, because the failed constraint message in that version differs from the one expected: "CHECK constraint failed" is expected, but "(sqlite3.IntegrityError) constraint failed" is received. Fixing this by setting the regexp to an error message that matches in both versions. Change-Id: I4b09eb4c3804fb9279a5acb3c1409def739e28c3 --- ironic_inspector/test/unit/test_node_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ironic_inspector/test/unit/test_node_cache.py b/ironic_inspector/test/unit/test_node_cache.py index 80aa7d298..3ef8d1c48 100644 --- a/ironic_inspector/test/unit/test_node_cache.py +++ b/ironic_inspector/test/unit/test_node_cache.py @@ -844,7 +844,7 @@ class TestNodeInfoState(test_base.NodeStateTest): def test_set_invalid_state(self): six.assertRaisesRegex(self, oslo_db.exception.DBError, - 'CHECK constraint failed', + 'constraint failed', self.node_info._set_state, 'foo') def test_commit(self):