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
|
# Skip Cholesky since we are explicitly testing non-hermitian
|
||||||
# spectra.
|
# spectra.
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
def operator_and_matrix(
|
def operator_and_matrix(
|
||||||
@ -533,7 +533,7 @@ class LinearOperatorCirculant2DTestNonHermitianSpectrum(
|
|||||||
return [dtypes.complex64, dtypes.complex128]
|
return [dtypes.complex64, dtypes.complex128]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
def operator_and_matrix(
|
def operator_and_matrix(
|
||||||
|
@ -44,7 +44,7 @@ class SquareLinearOperatorCompositionTest(
|
|||||||
self._rtol[dtypes.complex64] = 1e-4
|
self._rtol[dtypes.complex64] = 1e-4
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
# Cholesky not implemented.
|
# Cholesky not implemented.
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class LinearOperatorHouseholderTest(
|
|||||||
shape_info((2, 1, 4, 4))]
|
shape_info((2, 1, 4, 4))]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
# This linear operator is never positive definite.
|
# This linear operator is never positive definite.
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ class LinearOperatorLowRankUpdatetestWithDiagCannotUseCholesky(
|
|||||||
"""A = L + UDU^H, D !> 0, L > 0 ==> A !> 0 and we cannot use a Cholesky."""
|
"""A = L + UDU^H, D !> 0, L > 0 ==> A !> 0 and we cannot use a Cholesky."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
_use_diag_update = True
|
_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."""
|
"""A = L + UV^H, L > 0 ==> A is not symmetric and we cannot use a Cholesky."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
_use_diag_update = False
|
_use_diag_update = False
|
||||||
|
@ -34,7 +34,7 @@ class LinearOperatorLowerTriangularTest(
|
|||||||
"""Most tests done in the base class LinearOperatorDerivedClassTest."""
|
"""Most tests done in the base class LinearOperatorDerivedClassTest."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
# Cholesky does not make sense for triangular matrices.
|
# Cholesky does not make sense for triangular matrices.
|
||||||
return ["cholesky"]
|
return ["cholesky"]
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class LinearOperatorToeplitzTest(
|
|||||||
self._rtol[dtypes.complex128] = 1e-10
|
self._rtol[dtypes.complex128] = 1e-10
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
# Skip solve tests, as these could have better stability
|
# Skip solve tests, as these could have better stability
|
||||||
# (currently exercises the base class).
|
# (currently exercises the base class).
|
||||||
# TODO(srvasude): Enable these when solve is implemented.
|
# TODO(srvasude): Enable these when solve is implemented.
|
||||||
|
@ -37,7 +37,7 @@ class LinearOperatorZerosTest(
|
|||||||
"""Most tests done in the base class LinearOperatorDerivedClassTest."""
|
"""Most tests done in the base class LinearOperatorDerivedClassTest."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
return [
|
return [
|
||||||
"cholesky", "log_abs_det", "inverse", "solve", "solve_with_broadcast"]
|
"cholesky", "log_abs_det", "inverse", "solve", "solve_with_broadcast"]
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class LinearOperatorDerivedClassTest(test.TestCase):
|
|||||||
raise NotImplementedError("make_x is not defined.")
|
raise NotImplementedError("make_x is not defined.")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
"""List of test names to skip."""
|
"""List of test names to skip."""
|
||||||
# Subclasses should over-ride if they want to skip some tests.
|
# Subclasses should over-ride if they want to skip some tests.
|
||||||
# To skip "test_foo", add "foo" to this list.
|
# 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():
|
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
|
continue
|
||||||
|
|
||||||
for dtype, use_placeholder, shape_info in itertools.product(
|
for dtype, use_placeholder, shape_info in itertools.product(
|
||||||
@ -674,7 +674,7 @@ class NonSquareLinearOperatorDerivedClassTest(LinearOperatorDerivedClassTest):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tests_to_skip():
|
def skip_these_tests():
|
||||||
"""List of test names to skip."""
|
"""List of test names to skip."""
|
||||||
return [
|
return [
|
||||||
"cholesky",
|
"cholesky",
|
||||||
|
Loading…
Reference in New Issue
Block a user