mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Forbid creating of stream objects outside of asyncio (#13101)
This commit is contained in:
parent
2cc0223f43
commit
ad4ed87241
5 changed files with 203 additions and 76 deletions
|
@ -510,6 +510,18 @@ class SubprocessMixin:
|
|||
|
||||
self.loop.run_until_complete(execute())
|
||||
|
||||
def test_subprocess_protocol_create_warning(self):
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
subprocess.SubprocessStreamProtocol(limit=10, loop=self.loop)
|
||||
|
||||
def test_process_create_warning(self):
|
||||
proto = subprocess.SubprocessStreamProtocol(limit=10, loop=self.loop,
|
||||
_asyncio_internal=True)
|
||||
transp = mock.Mock()
|
||||
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
subprocess.Process(transp, proto, loop=self.loop)
|
||||
|
||||
|
||||
if sys.platform != 'win32':
|
||||
# Unix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue