Commits

Denis Bilenko  committed 2778aff

add greentest/test__subprocess_interrupted.py

  • Participants
  • Parent commits 5dca6e9

Comments (0)

Files changed (1)

File greentest/test__subprocess_interrupted.py

+import sys
+import os
+
+
+if 'runtestcase' in sys.argv[1:]:
+    import gevent
+    import gevent.subprocess
+    gevent.spawn(sys.exit, 'bye')
+    gevent.subprocess.Popen('python -c "1/0"'.split())
+    gevent.sleep(1)
+else:
+    import subprocess
+    for _ in xrange(5):
+        out, err = subprocess.Popen([sys.executable, __file__, 'runtestcase'], stderr=subprocess.PIPE).communicate()
+        assert err.strip() == 'bye', err