From a90fe8f6dd4b34e7a6d69a2dd288473b9dc2b50b Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 28 Oct 2024 23:30:12 -0700 Subject: [PATCH] Use assertIn instead of assertContainsSubsequence for substring checks. A contained subsequence must not necessarily be continuous, so the check only checked if the individual letters were appearing in order within the message, possibly interspersed with other characters. PiperOrigin-RevId: 690890495 --- tensorflow_probability/python/sts/default_model_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow_probability/python/sts/default_model_test.py b/tensorflow_probability/python/sts/default_model_test.py index d679401533..cc5a05cb5d 100644 --- a/tensorflow_probability/python/sts/default_model_test.py +++ b/tensorflow_probability/python/sts/default_model_test.py @@ -61,9 +61,9 @@ def test_has_expected_seasonality(self): self.assertIsInstance(model.components[0], local_linear_trend.LocalLinearTrend) self.assertIsInstance(model.components[1], seasonal.Seasonal) - self.assertContainsSubsequence(model.components[1].name, 'HOUR_OF_DAY') + self.assertIn('HOUR_OF_DAY', model.components[1].name) self.assertIsInstance(model.components[2], seasonal.Seasonal) - self.assertContainsSubsequence(model.components[2].name, 'DAY_OF_WEEK') + self.assertIn('DAY_OF_WEEK', model.components[2].name) def test_explicit_base_component(self): series = self._build_test_series(shape=[48], freq=pd.DateOffset(hours=1))