From 8cbe52a0f34f7798c8cd8d447440e43da94b021a Mon Sep 17 00:00:00 2001 From: Ian Langmore Date: Wed, 24 Jul 2019 15:15:10 -0700 Subject: [PATCH] TESTFIX: `tests_to_skip` staticmethod renamed to `skip_these_tests`. This prevents conflict with python testing, which automatically runs any method starting with "test" PiperOrigin-RevId: 259826835 --- .../kernel_tests/linalg/linear_operator_circulant_test.py | 4 ++-- .../kernel_tests/linalg/linear_operator_composition_test.py | 2 +- .../kernel_tests/linalg/linear_operator_householder_test.py | 2 +- .../linalg/linear_operator_low_rank_update_test.py | 4 ++-- .../linalg/linear_operator_lower_triangular_test.py | 2 +- .../kernel_tests/linalg/linear_operator_toeplitz_test.py | 2 +- .../kernel_tests/linalg/linear_operator_zeros_test.py | 2 +- tensorflow/python/ops/linalg/linear_operator_test_util.py | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py index 4c54ec6117c..f0e7efd578f 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py @@ -246,7 +246,7 @@ class LinearOperatorCirculantTestNonHermitianSpectrum( # Skip Cholesky since we are explicitly testing non-hermitian # spectra. @staticmethod - def tests_to_skip(): + def skip_these_tests(): return ["cholesky"] def operator_and_matrix( @@ -533,7 +533,7 @@ class LinearOperatorCirculant2DTestNonHermitianSpectrum( return [dtypes.complex64, dtypes.complex128] @staticmethod - def tests_to_skip(): + def skip_these_tests(): return ["cholesky"] def operator_and_matrix( diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_composition_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_composition_test.py index 2321a8c6d57..ba611a450c2 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_composition_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_composition_test.py @@ -44,7 +44,7 @@ class SquareLinearOperatorCompositionTest( self._rtol[dtypes.complex64] = 1e-4 @staticmethod - def tests_to_skip(): + def skip_these_tests(): # Cholesky not implemented. return ["cholesky"] diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_householder_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_householder_test.py index b333dbf6ff4..4179d450ad1 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_householder_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_householder_test.py @@ -46,7 +46,7 @@ class LinearOperatorHouseholderTest( shape_info((2, 1, 4, 4))] @staticmethod - def tests_to_skip(): + def skip_these_tests(): # This linear operator is never positive definite. return ["cholesky"] diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py index 5c89607c1da..c438187e35f 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py @@ -181,7 +181,7 @@ class LinearOperatorLowRankUpdatetestWithDiagCannotUseCholesky( """A = L + UDU^H, D !> 0, L > 0 ==> A !> 0 and we cannot use a Cholesky.""" @staticmethod - def tests_to_skip(): + def skip_these_tests(): return ["cholesky"] _use_diag_update = True @@ -224,7 +224,7 @@ class LinearOperatorLowRankUpdatetestNoDiagCannotUseCholesky( """A = L + UV^H, L > 0 ==> A is not symmetric and we cannot use a Cholesky.""" @staticmethod - def tests_to_skip(): + def skip_these_tests(): return ["cholesky"] _use_diag_update = False diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py index 02ce5b810eb..71d24e316fe 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py @@ -34,7 +34,7 @@ class LinearOperatorLowerTriangularTest( """Most tests done in the base class LinearOperatorDerivedClassTest.""" @staticmethod - def tests_to_skip(): + def skip_these_tests(): # Cholesky does not make sense for triangular matrices. return ["cholesky"] diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_toeplitz_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_toeplitz_test.py index 22ae26f27b4..dececb81375 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_toeplitz_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_toeplitz_test.py @@ -61,7 +61,7 @@ class LinearOperatorToeplitzTest( self._rtol[dtypes.complex128] = 1e-10 @staticmethod - def tests_to_skip(): + def skip_these_tests(): # Skip solve tests, as these could have better stability # (currently exercises the base class). # TODO(srvasude): Enable these when solve is implemented. diff --git a/tensorflow/python/kernel_tests/linalg/linear_operator_zeros_test.py b/tensorflow/python/kernel_tests/linalg/linear_operator_zeros_test.py index 49bbc69149a..086f5eeef3c 100644 --- a/tensorflow/python/kernel_tests/linalg/linear_operator_zeros_test.py +++ b/tensorflow/python/kernel_tests/linalg/linear_operator_zeros_test.py @@ -37,7 +37,7 @@ class LinearOperatorZerosTest( """Most tests done in the base class LinearOperatorDerivedClassTest.""" @staticmethod - def tests_to_skip(): + def skip_these_tests(): return [ "cholesky", "log_abs_det", "inverse", "solve", "solve_with_broadcast"] diff --git a/tensorflow/python/ops/linalg/linear_operator_test_util.py b/tensorflow/python/ops/linalg/linear_operator_test_util.py index 3d1e1fc2e24..30399bdd3d4 100644 --- a/tensorflow/python/ops/linalg/linear_operator_test_util.py +++ b/tensorflow/python/ops/linalg/linear_operator_test_util.py @@ -178,7 +178,7 @@ class LinearOperatorDerivedClassTest(test.TestCase): raise NotImplementedError("make_x is not defined.") @staticmethod - def tests_to_skip(): + def skip_these_tests(): """List of test names to skip.""" # Subclasses should over-ride if they want to skip some tests. # To skip "test_foo", add "foo" to this list. @@ -569,7 +569,7 @@ def add_tests(test_cls): ] for name, test_template_fn in test_name_dict.items(): - if name in test_cls.tests_to_skip(): + if name in test_cls.skip_these_tests(): continue for dtype, use_placeholder, shape_info in itertools.product( @@ -674,7 +674,7 @@ class NonSquareLinearOperatorDerivedClassTest(LinearOperatorDerivedClassTest): """ @staticmethod - def tests_to_skip(): + def skip_these_tests(): """List of test names to skip.""" return [ "cholesky",