cpython/Lib/unittest
Carl Friedrich Bolz-Tereick a327677905
bpo-39485: fix corner-case in method-detection of mock (GH-18252)
Replace check for whether something is a method in the mock module. The
previous version fails on PyPy, because there no method wrappers exist
(everything looks like a regular Python-defined function). Thus the
isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check
returns True for any descriptor, not just methods.

This condition could also return erroneously True in CPython for
C-defined descriptors.

Instead to decide whether something is a method, just check directly
whether it's a function defined on the class. This passes all tests on
CPython and fixes the bug on PyPy.
2020-01-29 15:43:37 +00:00
..
test Clarify and fix assertions that mocks have not been awaited (GH-18196) 2020-01-27 14:55:56 +00:00
__init__.py bpo-32972: Async test case (GH-13386) 2019-05-29 02:33:59 -07:00
__main__.py
async_case.py bpo-36373: Fix deprecation warnings (GH-15889) 2019-09-11 01:20:24 -07:00
case.py Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) 2019-11-19 21:34:03 +00:00
loader.py bpo-35767: Fix unittest.loader to allow partials as test_functions (#11600) 2019-01-23 21:57:25 +01:00
main.py
mock.py bpo-39485: fix corner-case in method-detection of mock (GH-18252) 2020-01-29 15:43:37 +00:00
result.py Fix typos in comments, docs and test names (#15018) 2019-07-30 18:16:13 -04:00
runner.py bpo-35513, unittest: TextTestRunner uses time.perf_counter() (GH-11180) 2018-12-17 11:30:34 +01:00
signals.py
suite.py bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) 2018-11-08 18:34:33 -08:00
util.py