Skip to content

Commit e28c3fb

Browse files
committed
Add property setters (untested)
1 parent 399bb66 commit e28c3fb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Lib/unittest/mock.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,18 +1482,34 @@ def is_started(self):
14821482
def is_local(self):
14831483
return self._context.is_local
14841484

1485+
@is_local.setter
1486+
def is_local(self, value):
1487+
self._context.is_local = value
1488+
14851489
@property
14861490
def original(self):
14871491
return self._context.original
14881492

1493+
@original.setter
1494+
def original(self, value):
1495+
self._context.original = value
1496+
14891497
@property
14901498
def target(self):
14911499
return self._context.target
14921500

1501+
@target.setter
1502+
def target(self, value):
1503+
self._context.target = value
1504+
14931505
@property
14941506
def temp_original(self): # backwards compatibility
14951507
return self.original
14961508

1509+
@temp_original.setter
1510+
def temp_original(self, value): # backwards compatibility
1511+
self.original = value
1512+
14971513
def __enter__(self):
14981514
"""Perform the patch."""
14991515
if self.is_started:

0 commit comments

Comments
 (0)