Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: tests/subprocess2_test.py

Issue 8462008: Implement accelerated tee support for POSIX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Add comments Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « subprocess2.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/subprocess2_test.py
diff --git a/tests/subprocess2_test.py b/tests/subprocess2_test.py
index 6d31d188251e7cb8b5726327d62fe2bfed6c1c1e..cb390751e2c9b47e35c7f42e5ee57394f7371e81 100755
--- a/tests/subprocess2_test.py
+++ b/tests/subprocess2_test.py
@@ -12,6 +12,11 @@ import sys
import time
import unittest
+try:
+ import fcntl
+except ImportError:
+ fcntl = None
+
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR)
@@ -182,6 +187,16 @@ class S2Test(unittest.TestCase):
super(S2Test, self).setUp()
self.exe_path = __file__
self.exe = [sys.executable, self.exe_path, '--child']
+ self.states = {}
+ if fcntl:
+ for v in (sys.stdin, sys.stdout, sys.stderr):
+ fileno = v.fileno()
+ self.states[fileno] = fcntl.fcntl(fileno, fcntl.F_GETFL)
+
+ def tearDown(self):
+ for fileno, fl in self.states.iteritems():
+ self.assertEquals(fl, fcntl.fcntl(fileno, fcntl.F_GETFL))
+ super(S2Test, self).tearDown()
def _run_test(self, function):
"""Runs tests in 6 combinations:
« no previous file with comments | « subprocess2.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698