Skip to content

Commit

Permalink
Use assertIn instead of assertContainsSubsequence for substring checks.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Googler authored and tensorflower-gardener committed Oct 29, 2024
1 parent ee09c17 commit a90fe8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tensorflow_probability/python/sts/default_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a90fe8f

Please sign in to comment.