Skip to content

Commit febda6f

Browse files
committed
Clarify unittest.mock.patch patchability test docstring
1 parent 436bcaa commit febda6f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/deprecation/test_cmd_git.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,11 @@ def test_use_shell_is_mock_patchable_on_class_as_object_attribute(
292292
correct one to restore, even by a normal setattr.
293293
294294
The effect is that some ways of simulating a class attribute with added behavior can
295-
cause a descriptor, such as a property, to be set to its own backing attribute
296-
during unpatching; then subsequent reads raise RecursionError. This happens if both
297-
(a) setting it on the class is customized in a metaclass and (b) getting it on
298-
instances is customized with a descriptor (such as a property) in the class itself.
295+
cause a descriptor, such as a property, to be set as the value of its own backing
296+
attribute during unpatching; then subsequent reads raise RecursionError. This
297+
happens if both (a) setting it on the class is customized in a metaclass and (b)
298+
getting it on instances is customized with a descriptor (such as a property) in the
299+
class itself.
299300
300301
Although ideally code outside GitPython would not rely on being able to patch
301302
Git.USE_SHELL with unittest.mock.patch, the technique is widespread. Thus, USE_SHELL

0 commit comments

Comments
 (0)