aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/test
diff options
context:
space:
mode:
authorGravatar Geoffrey Irving <geoffreyi@google.com>2016-04-29 15:13:28 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-04-29 16:22:02 -0700
commit36d561c253844323fb1de28303407b451b7886a7 (patch)
tree207abb6b6d4c312077ce865d3595c0f176c079f9 /tensorflow/tools/test
parent9a10198dca84891d8ab01a942fcabaaa5752230c (diff)
Reenable check_futures_test
Also fix a bunch of files that ended up without future imports while it was off. Change: 121161570
Diffstat (limited to 'tensorflow/tools/test')
-rw-r--r--tensorflow/tools/test/BUILD15
-rw-r--r--tensorflow/tools/test/check_futures_test.py7
2 files changed, 10 insertions, 12 deletions
diff --git a/tensorflow/tools/test/BUILD b/tensorflow/tools/test/BUILD
index 23d9cc6444..bdf4037ca9 100644
--- a/tensorflow/tools/test/BUILD
+++ b/tensorflow/tools/test/BUILD
@@ -95,11 +95,10 @@ filegroup(
visibility = ["//tensorflow:__subpackages__"],
)
-# TODO(irving): Reenable once the all_opensource_files mess is resolved.
-# py_test(
-# name = "check_futures_test",
-# size = "small",
-# srcs = ["check_futures_test.py"],
-# data = ["//tensorflow:all_opensource_files"],
-# srcs_version = "PY2AND3",
-# )
+py_test(
+ name = "check_futures_test",
+ size = "small",
+ srcs = ["check_futures_test.py"],
+ data = ["//tensorflow:all_opensource_files"],
+ srcs_version = "PY2AND3",
+)
diff --git a/tensorflow/tools/test/check_futures_test.py b/tensorflow/tools/test/check_futures_test.py
index a50cbda16d..2f7ebc418c 100644
--- a/tensorflow/tools/test/check_futures_test.py
+++ b/tensorflow/tools/test/check_futures_test.py
@@ -31,6 +31,8 @@ import fnmatch
import os
import re
+import six
+
BASE_DIR = os.path.normpath(os.path.join(__file__, '../../..'))
FUTURES_PATTERN = re.compile(r'^from __future__ import (\w+)\s*$')
FUTURES_PATTERN_2 = re.compile(
@@ -39,14 +41,11 @@ REQUIRED_FUTURES = frozenset(['absolute_import', 'division', 'print_function'])
WHITELIST = [
'python/platform/control_imports.py',
- 'python/platform/default/_init.py', # TODO(irving): Will vanish soon
'tools/docker/jupyter_notebook_config.py',
]
# Tests that must *not* import division
OLD_DIVISION = [
- # TODO(irving): Remove word2vec after 0.6.0 is released.
- 'examples/tutorials/word2vec/word2vec_basic.py',
'python/framework/tensor_shape_div_test.py',
'python/kernel_tests/division_past_test.py',
]
@@ -55,7 +54,7 @@ OLD_DIVISION = [
def check_file(path, old_division):
futures = set()
count = 0
- for line in open(path):
+ for line in open(path, encoding='utf-8') if six.PY3 else open(path):
count += 1
m = FUTURES_PATTERN.match(line)
if m: