| 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
|
|
|