Commit 059c7569 authored by Jason Madden's avatar Jason Madden

leak checks.

parent faf1ec7c
......@@ -73,12 +73,25 @@ class _RefCountChecker(object):
self.needs_setUp = False
def _ignore_object_p(self, obj):
if (
obj is self
or obj in self.__dict__.values()
or obj == self._ignore_object_p # pylint:disable=comparison-with-callable
):
if obj is self:
return False
try:
# Certain badly written __eq__ and __contains__ methods
# (I'm looking at you, Python 3.10 importlib.metadata._text!
# ``__eq__(self, other): return self.lower() == other.lower()``)
# raise AttributeError which propagates here, and must be caught.
# Similarly, we can get a TypeError
if (
obj in self.__dict__.values()
or obj == self._ignore_object_p # pylint:disable=comparison-with-callable
):
return False
except (AttributeError, TypeError):
# `obj` is things like that _text class. Also have seen
# - psycopg2._psycopg.type
# - relstorage.adapters.drivers._ClassDriverFactory
return True
kind = type(obj)
if kind in self.IGNORED_TYPES:
return False
......
......@@ -257,6 +257,7 @@ disabled_tests = [
# The same patch that fixed that removed this test,
# because it would now fail.
'test_context.ContextTest.test_context_var_new_2',
]
......@@ -550,8 +551,15 @@ if WIN:
# 'No connection could be made because the target machine
# actively refused it'
'test_socket.NonBlockingTCPTests.testAccept',
# On appveyor, this test has been seen to fail on 3.9 and 3.8
]
if sys.version_info[2] <= (3, 9):
disabled_tests += [
'test_context.HamtTest.test_hamt_collision_3',
]
# These are a problem on 3.5; on 3.6+ they wind up getting (accidentally) disabled.
wrapped_tests.update({
'test_socket.SendfileUsingSendTest.testWithTimeout': _flaky_socket_timeout,
......@@ -962,12 +970,6 @@ if ARES:
'test_socket.GeneralModuleTests.test_getnameinfo',
]
if sys.version_info[1] == 5:
disabled_tests += [
# This test tends to time out, but only under 3.5, not under
# 3.6 or 3.7. Seen with both libev and libuv
'test_socket.SendfileUsingSendTest.testWithTimeoutTriggeredSend',
]
disabled_tests += [
'test_threading.MiscTestCase.test__all__',
......
......@@ -1085,5 +1085,4 @@ class ContextTest(unittest.TestCase):
if __name__ == "__main__":
if not monkey.PY37:
unittest.main()
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment