diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2019-05-06 22:52:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 22:52:11 -0400 |
commit | ad4ed872415d00fcdfaa52a08108ec752b115000 (patch) | |
tree | a5c184a083a977b1bec239d25e313bd21d1aa505 /Lib/test/test_asyncio/test_subprocess.py | |
parent | 2cc0223f43a1ffd59c887a73e2b0ce5202f3be90 (diff) | |
download | cpython-ad4ed872415d00fcdfaa52a08108ec752b115000.tar.gz cpython-ad4ed872415d00fcdfaa52a08108ec752b115000.zip |
Forbid creating of stream objects outside of asyncio (#13101)
Diffstat (limited to 'Lib/test/test_asyncio/test_subprocess.py')
-rw-r--r-- | Lib/test/test_asyncio/test_subprocess.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index a5bdb8eca51..3908aabf5a1 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -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 |