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

Unified Diff: scripts/slave/unittests/recipes_test.py

Issue 17635005: Make blink_trybot recipe work on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fix presubmit + move polyfill (retry) Created 7 years, 6 months 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
Index: scripts/slave/unittests/recipes_test.py
diff --git a/scripts/slave/unittests/recipes_test.py b/scripts/slave/unittests/recipes_test.py
index 19bd064ea68d32ee9620d752d06bfafa77acae26..ddc4b6e40e388a0112c1d8e32a54a3fa8f96537b 100755
--- a/scripts/slave/unittests/recipes_test.py
+++ b/scripts/slave/unittests/recipes_test.py
@@ -41,7 +41,6 @@ import contextlib
import json
import os
import sys
-import unittest
from glob import glob
@@ -49,6 +48,9 @@ import test_env # pylint: disable=W0611
import coverage
+import common.python26_polyfill # pylint: disable=W0611
+import unittest
+
from common import annotator
SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__))
@@ -198,7 +200,7 @@ def train_from_tests(recipe_path):
steps = execute_test_case(test_data, recipe_path)
expected_path = expected_for(recipe_path, name)
print 'Writing', expected_path
- with open(expected_path, 'w') as f:
+ with open(expected_path, 'wb') as f:
f.write('[')
first = True
for step in steps:
@@ -228,7 +230,7 @@ def load_tests(loader, _standard_tests, _pattern):
steps = execute_test_case(test_data, recipe_path)
# Roundtrip json to get same string encoding as load
steps = json.loads(json.dumps(steps))
- with open(expected_path, 'r') as f:
+ with open(expected_path, 'rb') as f:
expected = json.load(f)
self.assertEqual(steps, expected)
test_.__name__ += name

Powered by Google App Engine
This is Rietveld 408576698