Issue #26325: Added test.support.check_no_resource_warning() to check that

no ResourceWarning is emitted.
This commit is contained in:
Serhiy Storchaka 2016-02-11 13:11:44 +02:00
parent e93b06a0a3
commit 94a619d48b
5 changed files with 32 additions and 20 deletions

View file

@ -427,10 +427,9 @@ class SubprocessMixin:
create = asyncio.create_subprocess_exec(sys.executable, '-c',
'pass', loop=self.loop)
with warnings.catch_warnings(record=True) as warns:
with support.check_no_resource_warning(self):
with self.assertRaises(exc):
self.loop.run_until_complete(create)
self.assertEqual(warns, [])
if sys.platform != 'win32':