summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Library
diff options
context:
space:
mode:
authorAbraham Toriz Cruz <awonderfulcode@gmail.com>2019-09-17 11:16:08 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-09-17 11:16:08 (GMT)
commit5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa (patch)
tree18cdf4ee14ec18b596aa1ea5f6fb4ad60bccc508 /Misc/NEWS.d/next/Library
parent219fb9d65ef7e5363eccc9dde0988bb085db1c86 (diff)
downloadcpython-5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa.zip
cpython-5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa.tar.gz
cpython-5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa.tar.bz2
bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)
In the format string for assert_called the evaluation order is incorrect and hence for mock's without name, 'None' is printed whereas it should be 'mock' like for other messages. The error message is ("Expected '%s' to have been called." % self._mock_name or 'mock').
Diffstat (limited to 'Misc/NEWS.d/next/Library')
-rw-r--r--Misc/NEWS.d/next/Library/2019-09-15-21-31-18.bpo-37828.gLLDX7.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-09-15-21-31-18.bpo-37828.gLLDX7.rst b/Misc/NEWS.d/next/Library/2019-09-15-21-31-18.bpo-37828.gLLDX7.rst
new file mode 100644
index 0000000..c364009
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-09-15-21-31-18.bpo-37828.gLLDX7.rst
@@ -0,0 +1,2 @@
+Fix default mock name in :meth:`unittest.mock.Mock.assert_called` exceptions.
+Patch by Abraham Toriz Cruz.