cpython/Lib/unittest
Gregory P. Smith 4042e1afd2
[3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364) (GH-16374)
Handle spec errors in assert_has_calls (GH-16005) (GH-16364)

The fix in PR 13261 handled the underlying issue about the spec for specific methods not being applied correctly, but it didn't fix the issue that was causing the misleading error message.

The code currently grabs a list of responses from _call_matcher (which may include exceptions). But it doesn't reach inside the list when checking if the result is an exception. This results in a misleading error message when one of the provided calls does not match the spec.

https://bugs.python.org/issue36871

Co-authored-by: Samuel Freilich <sfreilich@google.com>

(cherry picked from commit 1a17a054f6)
2019-09-24 22:29:17 -07:00
..
test [3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364) (GH-16374) 2019-09-24 22:29:17 -07:00
__init__.py Issue #28303: Fix grammar in unittest.__doc__, patch by Shlomi Fish 2016-09-28 17:28:41 +03:00
__main__.py bpo-29919: Remove unused imports found by pyflakes (#137) 2017-03-27 16:05:26 +02:00
case.py [3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645) 2019-04-01 10:59:24 +03:00
loader.py bpo-35767: Fix unittest.loader to allow partials as test_functions (GH-11600) (#11662) 2019-01-24 18:30:59 +01:00
main.py bpo-32071: Add unittest -k option (#4496) 2017-11-25 16:23:52 +01:00
mock.py [3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364) (GH-16374) 2019-09-24 22:29:17 -07:00
result.py Issue #27076: Doc, comment and tests spelling fixes 2016-05-26 05:35:26 +00:00
runner.py bpo-35513, unittest: TextTestRunner uses time.perf_counter() (GH-11180) 2018-12-17 02:49:22 -08:00
signals.py
suite.py Issue #27171: Fix typos in documentation, comments, and test function names 2016-06-02 10:07:09 +00:00
util.py bpo-32360: unittest.util: Use Counter instead of custom count function (GH-4994) 2018-01-24 16:49:58 +09:00