diff options
author | Matthew Suozzo <msuozzo@google.com> | 2022-02-03 03:41:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 00:41:19 -0800 |
commit | 6394e981adaca2c0daa36c8701611e250d74024c (patch) | |
tree | e045af3b3a17ab2bfa72e44aa711ad046c8ba4bb /Lib/unittest/test/testmock/testwith.py | |
parent | 8726067ace98a27557e9fdf1a8e1c509c37cfcfc (diff) | |
download | cpython-6394e981adaca2c0daa36c8701611e250d74024c.tar.gz cpython-6394e981adaca2c0daa36c8701611e250d74024c.zip |
Restrict use of Mock objects as specs (GH-31090)
Follow-on to https://github.com/python/cpython/pull/25326
This covers cases where mock objects are passed directly to spec.
Diffstat (limited to 'Lib/unittest/test/testmock/testwith.py')
-rw-r--r-- | Lib/unittest/test/testmock/testwith.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/unittest/test/testmock/testwith.py index 42ebf3898c8..c74d49a63c8 100644 --- a/Lib/unittest/test/testmock/testwith.py +++ b/Lib/unittest/test/testmock/testwith.py @@ -130,8 +130,8 @@ class WithTest(unittest.TestCase): c = C() - with patch.object(c, 'f', autospec=True) as patch1: - with patch.object(c, 'f', autospec=True) as patch2: + with patch.object(c, 'f') as patch1: + with patch.object(c, 'f') as patch2: c.f() self.assertEqual(patch2.call_count, 1) self.assertEqual(patch1.call_count, 0) |