aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-01-24 17:49:28 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-24 17:53:20 -0800
commit8a5b0f457c89e3ae77f67628654c1b64c4e65000 (patch)
treedaf79bd962d31741df5708384090e24b1b866841
parent0412e0946bdd2765d5c3dba0cc9b12b8650f564a (diff)
Make resource_variable_ops_test.py work with the C API enabled.
PiperOrigin-RevId: 183171341
-rw-r--r--tensorflow/python/kernel_tests/resource_variable_ops_test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/python/kernel_tests/resource_variable_ops_test.py b/tensorflow/python/kernel_tests/resource_variable_ops_test.py
index 7b131a5b8c..b4b555591d 100644
--- a/tensorflow/python/kernel_tests/resource_variable_ops_test.py
+++ b/tensorflow/python/kernel_tests/resource_variable_ops_test.py
@@ -38,6 +38,7 @@ from tensorflow.python.ops import variables
from tensorflow.python.platform import test
+@test_util.with_c_api
class ResourceVariableOpsTest(test_util.TensorFlowTestCase):
def tearDown(self):
@@ -342,14 +343,14 @@ class ResourceVariableOpsTest(test_util.TensorFlowTestCase):
v = resource_variable_ops.ResourceVariable(
2.0, caching_device="/job:localhost")
self.assertEqual("/job:localhost", v.value().device)
- with self.assertRaisesRegexp(ValueError, "No attr named '_class'"):
+ with self.assertRaises(ValueError):
_ = v.value().op.get_attr("_class")
with ops.colocate_with(v.op):
w = resource_variable_ops.ResourceVariable(
2.0, caching_device="/job:localhost")
self.assertEqual("/job:localhost", w.value().device)
- with self.assertRaisesRegexp(ValueError, "No attr named '_class'"):
+ with self.assertRaises(ValueError):
_ = w.value().op.get_attr("_class")
def testSharedName(self):