summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorvabr-g <vabr@google.com>2020-12-14 18:30:09 (GMT)
committerGitHub <noreply@github.com>2020-12-14 18:30:09 (GMT)
commitfdb9efce6ac211f973088eef508740c3fa2bd182 (patch)
tree9a109d25ccc8f22ed03710e3390fffc0b586674b /Misc
parent42c9f0fd0a5e67d4ae0022bfd7370cb9725a5b01 (diff)
downloadcpython-fdb9efce6ac211f973088eef508740c3fa2bd182.zip
cpython-fdb9efce6ac211f973088eef508740c3fa2bd182.tar.gz
cpython-fdb9efce6ac211f973088eef508740c3fa2bd182.tar.bz2
bpo-41877: Check for misspelled speccing arguments (GH-23737)
patch, patch.object and create_autospec silently ignore misspelled arguments such as autospect, auto_spec and set_spec. This can lead to tests failing to check what they are supposed to check. This change adds a check causing a RuntimeError if the above functions get any of the above misspellings as arguments. It also adds a new argument, "unsafe", which can be set to True to disable this check. Also add "!r" to format specifiers in added error messages.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2020-12-10-19-49-52.bpo-41877.wiVlPc.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-12-10-19-49-52.bpo-41877.wiVlPc.rst b/Misc/NEWS.d/next/Library/2020-12-10-19-49-52.bpo-41877.wiVlPc.rst
new file mode 100644
index 0000000..d42200e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-12-10-19-49-52.bpo-41877.wiVlPc.rst
@@ -0,0 +1 @@
+A check is added against misspellings of autospect, auto_spec and set_spec being passed as arguments to patch, patch.object and create_autospec. \ No newline at end of file