diff -r 146157d91283 Lib/test/test_ssl.py --- a/Lib/test/test_ssl.py Thu Dec 22 10:40:44 2016 +0100 +++ b/Lib/test/test_ssl.py Thu Dec 22 15:43:32 2016 +0200 @@ -14,6 +14,7 @@ import pprint import urllib.request import traceback import asyncore +import warnings import weakref import platform import functools @@ -380,7 +381,9 @@ class BasicSocketTests(unittest.TestCase ss = test_wrap_socket(s) wr = weakref.ref(ss) with support.check_warnings(("", ResourceWarning)): + warnings.simplefilter("always", ResourceWarning) del ss + support.gc_collect() self.assertEqual(wr(), None) def test_wrapped_unconnected(self): diff -r 146157d91283 Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Thu Dec 22 10:40:44 2016 +0100 +++ b/Lib/test/test_subprocess.py Thu Dec 22 15:43:32 2016 +0200 @@ -15,6 +15,7 @@ import select import shutil import gc import textwrap +import warnings try: import threading @@ -2324,7 +2325,9 @@ class POSIXProcessTestCase(BaseTestCase) ident = id(p) pid = p.pid with support.check_warnings(('', ResourceWarning)): + warnings.simplefilter('always', ResourceWarning) p = None + support.gc_collect() # check that p is in the active processes list self.assertIn(ident, [id(o) for o in subprocess._active]) @@ -2345,7 +2348,9 @@ class POSIXProcessTestCase(BaseTestCase) ident = id(p) pid = p.pid with support.check_warnings(('', ResourceWarning)): + warnings.simplefilter('always', ResourceWarning) p = None + support.gc_collect() os.kill(pid, signal.SIGKILL) # check that p is in the active processes list