From 63cdc14853d9a0cd7da6416a5ca60121e86fd218 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 16 Jul 2021 11:26:06 +0900 Subject: [PATCH] Do not patch inspect.argspec directly This fixes the leftover of c1933306ddd8df09185c5d32ff2603d826d4ad5a and makes the get_method_spec method patched instead of inspect.argspec because now the method wraps call to inspect.argspec. Change-Id: Id3c18d151a6f239f7ceff4e0b24f4006963827ea --- oslo_versionedobjects/tests/test_fixture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_versionedobjects/tests/test_fixture.py b/oslo_versionedobjects/tests/test_fixture.py index 5ab392d..b22f441 100644 --- a/oslo_versionedobjects/tests/test_fixture.py +++ b/oslo_versionedobjects/tests/test_fixture.py @@ -584,7 +584,7 @@ class TestObjectVersionChecker(test.TestCase): argspec = 'cubone' self._add_class(self.obj_classes, ExtraDataObj) - with mock.patch('inspect.getargspec') as mock_gas: + with mock.patch.object(fixture, 'get_method_spec') as mock_gas: mock_gas.return_value = argspec fp = self.ovc._get_fingerprint(ExtraDataObj.__name__, extra_data_func=get_data) -- GitLab