summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testpatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/testmock/testpatch.py')
-rw-r--r--Lib/unittest/test/testmock/testpatch.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py
index 438dfd8..f1bc0e1 100644
--- a/Lib/unittest/test/testmock/testpatch.py
+++ b/Lib/unittest/test/testmock/testpatch.py
@@ -770,6 +770,14 @@ class PatchTest(unittest.TestCase):
self.assertEqual(d, original)
+ def test_patch_dict_stop_without_start(self):
+ d = {'foo': 'bar'}
+ original = d.copy()
+ patcher = patch.dict(d, [('spam', 'eggs')], clear=True)
+ self.assertEqual(patcher.stop(), False)
+ self.assertEqual(d, original)
+
+
def test_patch_dict_class_decorator(self):
this = self
d = {'spam': 'eggs'}