cpython/Lib/unittest/test
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
..
testmock [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
__main__.py
_test_warnings.py
dummy.py
support.py
test_assertions.py #30190: fix invalid escape sequence warnings (#1534) 2017-05-10 20:13:20 +02:00
test_break.py bpo-33746: Fix test_unittest.testRegisterResult() in verbose mode (GH-7799) 2018-06-20 02:50:03 -07:00
test_case.py bpo-34900: Make TestCase.debug() work with subtests (GH-9707) 2018-10-12 14:07:01 +03:00
test_discovery.py bpo-33748: fix tests altering sys.path and sys.modules (GH-7433) (#7604) 2018-06-10 17:45:19 -04:00
test_functiontestcase.py
test_loader.py bpo-35767: Fix unittest.loader to allow partials as test_functions (GH-11600) (#11662) 2019-01-24 18:30:59 +01:00
test_program.py bpo-32071: Add unittest -k option (#4496) 2017-11-25 16:23:52 +01:00
test_result.py bpo-30664: The description of a unittest subtest now preserves the (#2265) 2017-06-23 21:47:39 +03:00
test_runner.py bpo-32230: Set sys.warnoptions with -X dev (#4820) 2017-12-12 22:59:48 +01:00
test_setups.py
test_skipping.py
test_suite.py