summaryrefslogtreecommitdiff
path: root/ironic/tests
diff options
context:
space:
mode:
authorThomas Goirand <zigo@debian.org>2020-09-24 10:58:08 +0200
committerThomas Goirand <zigo@debian.org>2020-09-24 11:06:27 +0200
commita0b28708b1d8d1e05fe020aa99a504fa50221df4 (patch)
tree923b1ea8934f59577ba1049d9893bdbd20e26ad3 /ironic/tests
parent28c0f3832259e5b9323a42160143def8f4de1378 (diff)
downloadironic-a0b28708b1d8d1e05fe020aa99a504fa50221df4.tar.gz
autospec for classmethods and staticmethods for Python < 3.7.4
The workaround for allowing autospec for classmethods and staticmethods is also needed for Python 3.7.3, which is the version in Debian Buster. Indeed, the patch here: https://bugs.python.org/issue23078 was commited between the release of Python 3.7.3 and 3.7.4. See sha: 15a57a3cadb992bb1752302333ff593e7eab284c in the Python VCS. Change-Id: I46aedc7a318f2e77ec7e391478bc4e5baf65280e
Diffstat (limited to 'ironic/tests')
-rw-r--r--ironic/tests/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ironic/tests/base.py b/ironic/tests/base.py
index eccdb9a1b..e19a2380c 100644
--- a/ironic/tests/base.py
+++ b/ironic/tests/base.py
@@ -55,7 +55,7 @@ logging.setup(CONF, 'ironic')
# NOTE(rpittau) this function allows autospec for classmethods and
-# staticmethods in Python 3.6, while no issue occurs in Python 3.7
+# staticmethods in Python 3.6, while no issue occurs in Python 3.7.4
# and later.
# For more info please see: http://bugs.python.org/issue23078
def _patch_mock_callable(obj):
@@ -133,7 +133,7 @@ class TestCase(oslo_test_base.BaseTestCase):
# subprocess.Popen is a class
self.patch(subprocess, 'Popen', DoNotCallPopen)
- if sys.version_info < (3, 7):
+ if sys.version_info < (3, 7, 4):
_patch_mock_callable._old_func = mock._callable
mock._callable = _patch_mock_callable