Clarify and fix assertions that mocks have not been awaited (GH-18196)

- The gc.collect is needed for other implementations, such as pypy
- Using context managers over multiple lines will only catch the warning from the first line in the context!
- remove a skip for a test that no longer fails on pypy
This commit is contained in:
Chris Withers 2020-01-27 14:55:56 +00:00 committed by GitHub
parent c7dd3c7d87
commit a46575a8f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 27 deletions

View file

@ -1,7 +1,6 @@
import math
import unittest
import os
import sys
from asyncio import iscoroutinefunction
from unittest.mock import AsyncMock, Mock, MagicMock, _magics
@ -429,7 +428,6 @@ class TestMockingMagicMethods(unittest.TestCase):
self.assertEqual(dir(mock), ['foo'])
@unittest.skipIf('PyPy' in sys.version, "This fails differently on pypy")
def test_bound_methods(self):
m = Mock()