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
@sunmy2019 I'm not sure aa0a73d is the cause here (or, at least, it isn't the only thing in play); in my testing, that commit still raises a ValueError - although the presentation is slightly different, as it also includes
>>> m.bar
Traceback (most recent call last):
File "/Users/rkm/projects/python/cpython/github/Lib/unittest/mock.py", line 2957, in __get__
return self()
^^^^^^
File "/Users/rkm/projects/python/cpython/github/Lib/unittest/mock.py", line 1128, in __call__
return self._mock_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rkm/projects/python/cpython/github/Lib/unittest/mock.py", line 1132, in _mock_call
return self._execute_mock_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rkm/projects/python/cpython/github/Lib/unittest/mock.py", line 1187, in _execute_mock_call
raise effect
ValueError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/rkm/projects/python/cpython/github/Lib/unittest/mock.py", line 656, in __getattr__
if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <method 'startswith' of 'str' objects> returned a result with an exception set
whereas 3.11 et al raise:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/mock.py", line 2932, in __get__
return self()
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/mock.py", line 1118, in __call__
return self._mock_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/mock.py", line 1122, in _mock_call
return self._execute_mock_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/mock.py", line 1177, in _execute_mock_call
raise effect
ValueError
Activity
sunmy2019 commentedon Apr 7, 2023
A known on-going failure was introduced in the related components: aa0a73d
See #103272
Can anyone test if it starts here?
freakboy3742 commentedon Apr 7, 2023
@sunmy2019 I'm not sure aa0a73d is the cause here (or, at least, it isn't the only thing in play); in my testing, that commit still raises a ValueError - although the presentation is slightly different, as it also includes
whereas 3.11 et al raise:
sunmy2019 commentedon Apr 7, 2023
Looks like it was fixed by #103332
With current main, I got the same output as in your python3.11. @freakboy3742
carljm commentedon Apr 7, 2023
Before closing this issue, we should add a test for this case that would have failed on the original breaking PR.
Add regression test for python#103329.
freakboy3742 commentedon Apr 8, 2023
Confirming this has been fixed by #103332. I've submitted some regression tests in #103358.
gh-103329: Add regression test for PropertyMock with side effect (#10…
pythongh-103329: Add regression test for PropertyMock with side effect (
gh-103329: Add regression test for PropertyMock with side effect (GH-…
pythongh-103329: Add regression test for PropertyMock with side effect (