From dc20185f6af2e862bd62f9df7b835593a466c5f1 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 12 May 2022 13:02:14 -0700 Subject: [PATCH] Better test assertion. (#17551) --- sdks/python/apache_beam/io/gcp/bigquery_json_it_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/io/gcp/bigquery_json_it_test.py b/sdks/python/apache_beam/io/gcp/bigquery_json_it_test.py index 13bf63a46a1b3..25ce2b359f338 100644 --- a/sdks/python/apache_beam/io/gcp/bigquery_json_it_test.py +++ b/sdks/python/apache_beam/io/gcp/bigquery_json_it_test.py @@ -100,13 +100,13 @@ def process(self, row): # Test country (JSON String) country_actual = json.loads(row["country"]) country_expected = json.loads(expected["country"]) - self.assertTrue(country_expected == country_actual) + self.assertEqual(country_expected, country_actual) # Test stats (JSON String in BigQuery struct) for stat, value in row["stats"].items(): stats_actual = json.loads(value) stats_expected = json.loads(expected["stats"][stat]) - self.assertTrue(stats_expected == stats_actual) + self.assertEqual(stats_expected, stats_actual) # Test cities (JSON String in BigQuery array of structs) for city_row in row["cities"]: @@ -115,7 +115,7 @@ def process(self, row): city_actual = json.loads(city) city_expected = json.loads(expected["cities"][city_name]) - self.assertTrue(city_expected == city_actual) + self.assertEqual(city_expected, city_actual) # Test landmarks (JSON String in BigQuery array) landmarks_actual = row["landmarks"] @@ -123,7 +123,7 @@ def process(self, row): for i in range(len(landmarks_actual)): l_actual = json.loads(landmarks_actual[i]) l_expected = json.loads(landmarks_expected[i]) - self.assertTrue(l_expected == l_actual) + self.assertEqual(l_expected, l_actual) parser = argparse.ArgumentParser() parser.add_argument('--read_method')