X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=python-eventlet%2Ftests%2Fsubprocess_test.py;h=1f07518332d0ab22a0cd1fb560c9fb84727211f2;hb=refs%2Ftags%2Fmos-9.0;hp=085f656c1e8695cafa04c545a7e010f446b2bb40;hpb=358bd9258c2b6d2ee74de4dfd07a5123107abad4;p=packages%2Ftrusty%2Fpython-eventlet.git diff --git a/python-eventlet/tests/subprocess_test.py b/python-eventlet/tests/subprocess_test.py index 085f656..1f07518 100644 --- a/python-eventlet/tests/subprocess_test.py +++ b/python-eventlet/tests/subprocess_test.py @@ -1,8 +1,10 @@ +import sys +import time + import eventlet from eventlet.green import subprocess import eventlet.patcher -import sys -import time +import tests original_subprocess = eventlet.patcher.original('subprocess') @@ -64,3 +66,20 @@ def test_close_popen_stdin_with_close_fds(): p.stdin.close() except Exception as e: assert False, "Exception should not be raised, got %r instead" % e + + +def test_universal_lines(): + p = subprocess.Popen( + [sys.executable, '--version'], + shell=False, + stdout=subprocess.PIPE, + universal_newlines=True) + p.communicate(None) + + +def test_patched_communicate_290(): + # https://github.com/eventlet/eventlet/issues/290 + # Certain order of import and monkey_patch breaks subprocess communicate() + # with AttributeError module `select` has no `poll` on Linux + # unpatched methods are removed for safety reasons in commit f63165c0e3 + tests.run_isolated('subprocess_patched_communicate.py')