From 414f607374e7d5ee7048539aa2aa96fae040d6cb Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sat, 17 Sep 2016 02:29:52 +0000 Subject: [PATCH] Garbage collect HasStandardAttributes subclasses in StandardAttrTestCase Otherwise they may affect consequent calls to get_standard_attr_resource_model_map on next plugin instantiation. Change-Id: If8030776b3880e8c61980aeb28a65b397cca5ec4 Closes-Bug: #1625973 --- neutron/tests/unit/db/test_standard_attr.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neutron/tests/unit/db/test_standard_attr.py b/neutron/tests/unit/db/test_standard_attr.py index 904312cef84..b9945dd8590 100644 --- a/neutron/tests/unit/db/test_standard_attr.py +++ b/neutron/tests/unit/db/test_standard_attr.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import gc + from sqlalchemy.ext import declarative import testtools @@ -21,6 +23,9 @@ from neutron.tests.unit import testlib_api class StandardAttrTestCase(base.BaseTestCase): + def setUp(self): + super(StandardAttrTestCase, self).setUp() + self.addCleanup(gc.collect) def _make_decl_base(self): # construct a new base so we don't interfere with the main