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
This commit is contained in:
parent
a0568a18d8
commit
8cbe52a0f3
@ -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(
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user