Commit 5f4a9cc3 authored by Tom Ward's avatar Tom Ward Committed by Copybara-Service
Browse files

Move `disable_v2_behaviour()` to `setUp` to enable running tests in test suites.

PiperOrigin-RevId: 454823596
Change-Id: I893dc051a5f21d53905acee45a4dcb5c5609daf9
parent 157c0eaa
...@@ -27,6 +27,10 @@ def _random_bytes(): ...@@ -27,6 +27,10 @@ def _random_bytes():
class FeaturesTest(parameterized.TestCase, tf.test.TestCase): class FeaturesTest(parameterized.TestCase, tf.test.TestCase):
def setUp(self):
super().setUp()
tf.disable_v2_behavior()
def testFeatureNames(self): def testFeatureNames(self):
self.assertEqual(len(protein_features.FEATURE_SIZES), self.assertEqual(len(protein_features.FEATURE_SIZES),
len(protein_features.FEATURE_TYPES)) len(protein_features.FEATURE_TYPES))
...@@ -47,5 +51,4 @@ class FeaturesTest(parameterized.TestCase, tf.test.TestCase): ...@@ -47,5 +51,4 @@ class FeaturesTest(parameterized.TestCase, tf.test.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
tf.disable_v2_behavior()
absltest.main() absltest.main()
...@@ -21,6 +21,10 @@ import tensorflow.compat.v1 as tf ...@@ -21,6 +21,10 @@ import tensorflow.compat.v1 as tf
class ShapeTest(tf.test.TestCase): class ShapeTest(tf.test.TestCase):
def setUp(self):
super().setUp()
tf.disable_v2_behavior()
def test_shape_list(self): def test_shape_list(self):
"""Test that shape_list can allow for reshaping to dynamic shapes.""" """Test that shape_list can allow for reshaping to dynamic shapes."""
a = tf.zeros([10, 4, 4, 2]) a = tf.zeros([10, 4, 4, 2])
...@@ -35,5 +39,4 @@ class ShapeTest(tf.test.TestCase): ...@@ -35,5 +39,4 @@ class ShapeTest(tf.test.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
tf.disable_v2_behavior()
tf.test.main() tf.test.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment