Home
last modified time | relevance | path

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

/third_party/python/Lib/test/support/
D__init__.py1615 def patch(test_instance, object_to_patch, attr_name, new_value): argument
1625 getattr(object_to_patch, attr_name)
1630 old_value = object_to_patch.__dict__[attr_name]
1632 old_value = getattr(object_to_patch, attr_name, None)
1639 setattr(object_to_patch, attr_name, old_value)
1641 delattr(object_to_patch, attr_name)
1646 setattr(object_to_patch, attr_name, new_value)
/third_party/python/Doc/library/
Dtest.rst854 .. function:: patch(test_instance, object_to_patch, attr_name, new_value)
856 Override *object_to_patch.attr_name* with *new_value*. Also add
857 cleanup procedure to *test_instance* to restore *object_to_patch* for
859 *object_to_patch*.