From dc89e7cf61a7728837cc69bf1bbb15f99164c89b Mon Sep 17 00:00:00 2001 From: Andy Botting Date: Wed, 12 Oct 2022 21:13:39 +1100 Subject: [PATCH] Fix compatibility with Python 3.10 Since testing with Python 3.10, the test murano.tests.unit.dsl.test_helpers.TestDSLHelpers.test_weak_ref was failing with testtools.matchers._impl.MismatchError: 'weakref' != 'ReferenceType' This is simply the result of newer Python being more correct about the name of the weakref ReferenceType. The fix here is to ask what the name is of the class and use that instead of the hardcoded 'weakref' name. Change-Id: I26ea4750f10dedb04a07d188e57fcd391a28f870 --- murano/tests/unit/dsl/test_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/murano/tests/unit/dsl/test_helpers.py b/murano/tests/unit/dsl/test_helpers.py index 5b86a3d34..ec5ff2050 100644 --- a/murano/tests/unit/dsl/test_helpers.py +++ b/murano/tests/unit/dsl/test_helpers.py @@ -265,7 +265,7 @@ class TestDSLHelpers(base.MuranoTestCase): result = murano_object_weak_ref.__call__() self.assertEqual(mock.sentinel.res, result) - self.assertEqual('weakref', + self.assertEqual(weakref.ReferenceType.__name__, murano_object_weak_ref.ref.__class__.__name__) def test_weak_ref_with_null_obj(self):