aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/resource_variable_ops_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/kernel_tests/resource_variable_ops_test.py')
-rw-r--r--tensorflow/python/kernel_tests/resource_variable_ops_test.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/resource_variable_ops_test.py b/tensorflow/python/kernel_tests/resource_variable_ops_test.py
index 8cf8286ed1..6f2bc2f752 100644
--- a/tensorflow/python/kernel_tests/resource_variable_ops_test.py
+++ b/tensorflow/python/kernel_tests/resource_variable_ops_test.py
@@ -422,6 +422,16 @@ class ResourceVariableOpsTest(test_util.TensorFlowTestCase):
self.assertEqual(1, v1.read_value().numpy())
self.assertEqual(2, v2.read_value().numpy())
+ def testDestruction(self):
+ with context.eager_mode():
+ var = resource_variable_ops.ResourceVariable(initial_value=1.0,
+ name="var8")
+ var.__del__()
+ with self.assertRaisesRegexp(errors.NotFoundError,
+ r"Resource .*\/var8\/.* does not exist."):
+ resource_variable_ops.destroy_resource_op(var._handle,
+ ignore_lookup_error=False)
+
if __name__ == "__main__":
test.main()