diff options
-rw-r--r-- | Lib/test/test_unittest/testmock/testthreadingmock.py | 4 | ||||
-rw-r--r-- | Lib/unittest/mock.py | 7 |
2 files changed, 3 insertions, 8 deletions
diff --git a/Lib/test/test_unittest/testmock/testthreadingmock.py b/Lib/test/test_unittest/testmock/testthreadingmock.py index c6f1794..b6e12bc 100644 --- a/Lib/test/test_unittest/testmock/testthreadingmock.py +++ b/Lib/test/test_unittest/testmock/testthreadingmock.py @@ -11,10 +11,10 @@ threading_helper.requires_working_threading(module=True) class Something: def method_1(self): - pass + pass # pragma: no cover def method_2(self): - pass + pass # pragma: no cover class TestThreadingMock(unittest.TestCase): diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 3ed54b3..e8c8360 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -212,17 +212,12 @@ def _set_async_signature(mock, original, instance=False, is_async_mock=False): # signature as the original. skipfirst = isinstance(original, type) - result = _get_signature_object(original, instance, skipfirst) - if result is None: - return mock - func, sig = result + func, sig = _get_signature_object(original, instance, skipfirst) def checksig(*args, **kwargs): sig.bind(*args, **kwargs) _copy_func_details(func, checksig) name = original.__name__ - if not name.isidentifier(): - name = 'funcopy' context = {'_checksig_': checksig, 'mock': mock} src = """async def %s(*args, **kwargs): _checksig_(*args, **kwargs) |