You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is a discrepancy in unit tests' behavior between python 3.10 and 3.12.
I am currently using python 3.12 and TLS tests fail with:
_________________________________________ TestOpenSearchTLS.test_on_certificate_available_rotation_ongoing_on_another_unit_0_main_orchestrator _________________________________________
Traceback (most recent call last):
File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.12/unittest/case.py", line 634, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/home/pguimaraes/Documents/Canonical/Engineering/DPE-4115-perf-profiles/opensearch-operator/.tox/unit/lib/python3.12/site-packages/parameterized/parameterized.py", line 620, in standalone_func
return func(*(a + p.args), **p.kwargs, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/unittest/mock.py", line 1390, in patched
return func(*newargs, **newkeywargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pguimaraes/Documents/Canonical/Engineering/DPE-4115-perf-profiles/opensearch-operator/.tox/unit/lib/python3.12/site-packages/parameterized/parameterized.py", line 93, in dummy_func
return orgfunc(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/unittest/mock.py", line 1390, in patched
return func(*newargs, **newkeywargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pguimaraes/Documents/Canonical/Engineering/DPE-4115-perf-profiles/opensearch-operator/tests/unit/lib/test_opensearch_tls.py", line 1680, in test_on_certificate_available_rotation_ongoing_on_another_unit
self.charm.on.certificate_available.defer.called_once()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/unittest/mock.py", line 663, in __getattr__
raise AttributeError(
AttributeError: 'called_once' is not a valid assertion. Use a spec for the mock if 'called_once' is meant to be an attribute.
Once moving away from called_* to assert_called_*, and removing the assert keywords at the beginning of these lines, if any; I started to get more errors.
It seems there is a discrepancy in unit tests' behavior between python 3.10 and 3.12.
I am currently using python 3.12 and TLS tests fail with:
Once moving away from
called_*
toassert_called_*
, and removing theassert
keywords at the beginning of these lines, if any; I started to get more errors.I have compiled some of the fixes on: https://github.com/canonical/opensearch-operator/pull/466/files#diff-76015ac74eac172fd5f5aeeaf86dc52080e1241d591163aa2f9e12732f8db2c8
But there are some yet to be added.
The text was updated successfully, but these errors were encountered: