Home
last modified time | relevance | path

Searched refs:object_to_patch (Results 1 – 2 of 2) sorted by relevance

/external/python/cpython3/Lib/test/support/
D__init__.py2658 def patch(test_instance, object_to_patch, attr_name, new_value): argument
2668 getattr(object_to_patch, attr_name)
2673 old_value = object_to_patch.__dict__[attr_name]
2675 old_value = getattr(object_to_patch, attr_name, None)
2682 setattr(object_to_patch, attr_name, old_value)
2684 delattr(object_to_patch, attr_name)
2689 setattr(object_to_patch, attr_name, new_value)
/external/python/cpython3/Doc/library/
Dtest.rst1124 .. function:: patch(test_instance, object_to_patch, attr_name, new_value)
1126 Override *object_to_patch.attr_name* with *new_value*. Also add
1127 cleanup procedure to *test_instance* to restore *object_to_patch* for
1129 *object_to_patch*.