diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-09-10 14:36:26 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-10 14:49:41 -0700 |
commit | 890e16594a005fe703a5556530b0dc3e6527fa47 (patch) | |
tree | 99140efb13f392ae13a58f08c08754c61bf66f13 /tensorflow/contrib/cloud | |
parent | 132babebf5b1026cb33cad7c4eb7e03810c2acdf (diff) |
Move from deprecated self.test_session() to self.cached_session().
self.test_session() has been deprecated in 9962eb5e84b15e309410071b06c2ed2d6148ed44 as its name confuses readers of the test. Moving to cached_session() instead which is more explicit about:
* the fact that the session may be reused.
* the session is not closed even when doing a "with self.test_session()" statement.
PiperOrigin-RevId: 212336321
Diffstat (limited to 'tensorflow/contrib/cloud')
-rw-r--r-- | tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py | 4 | ||||
-rw-r--r-- | tensorflow/contrib/cloud/python/ops/gcs_config_ops_test.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py b/tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py index 493b3c6f1b..11e177cd0c 100644 --- a/tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py +++ b/tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py @@ -197,7 +197,7 @@ class BigQueryReaderOpsTest(test.TestCase): def _ReadAndCheckRowsUsingFeatures(self, num_rows): self.server.handler.num_rows = num_rows - with self.test_session() as sess: + with self.cached_session() as sess: feature_configs = { "int64_col": parsing_ops.FixedLenFeature( @@ -254,7 +254,7 @@ class BigQueryReaderOpsTest(test.TestCase): num_rows = 10 self.server.handler.num_rows = num_rows - with self.test_session() as sess: + with self.cached_session() as sess: reader = cloud.BigQueryReader( project_id=_PROJECT, dataset_id=_DATASET, diff --git a/tensorflow/contrib/cloud/python/ops/gcs_config_ops_test.py b/tensorflow/contrib/cloud/python/ops/gcs_config_ops_test.py index 9b6c056d6c..4f2ecbcb17 100644 --- a/tensorflow/contrib/cloud/python/ops/gcs_config_ops_test.py +++ b/tensorflow/contrib/cloud/python/ops/gcs_config_ops_test.py @@ -26,7 +26,7 @@ class GcsConfigOpsTest(test.TestCase): def testSetBlockCache(self): cfg = gcs_config_ops.BlockCacheParams(max_bytes=1024*1024*1024) - with self.test_session() as sess: + with self.cached_session() as sess: gcs_config_ops.configure_gcs(sess, block_cache=cfg) def testConfigureGcsHook(self): @@ -36,7 +36,7 @@ class GcsConfigOpsTest(test.TestCase): 'type': 'authorized_user'} hook = gcs_config_ops.ConfigureGcsHook(credentials=creds) hook.begin() - with self.test_session() as sess: + with self.cached_session() as sess: sess.run = lambda _, feed_dict=None, options=None, run_metadata=None: None hook.after_create_session(sess, None) |