def test_almost_valid_name(self):
        """Test initialization with a name close to a valid one."""
        with self.assertRaisesRegex(ValueError, "Cannot convert"):
            QuantizedDTypePolicy(
                mode="int8", source_name="int7_from_mixed_bfloat16"
            )
Test initialization with a name close to a valid one.
keras/src/dtype_policies/dtype_policy_test.py