You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by go...@apache.org on 2022/05/12 20:02:20 UTC

[beam] branch master updated: Better test assertion. (#17551)

This is an automated email from the ASF dual-hosted git repository.

goenka pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new dc20185f6af Better test assertion. (#17551)
dc20185f6af is described below

commit dc20185f6af2e862bd62f9df7b835593a466c5f1
Author: Robert Bradshaw <ro...@gmail.com>
AuthorDate: Thu May 12 13:02:14 2022 -0700

    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 13bf63a46a1..25ce2b359f3 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 @@ class BigQueryJsonIT(unittest.TestCase):
         # 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 @@ class BigQueryJsonIT(unittest.TestCase):
 
           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 @@ class BigQueryJsonIT(unittest.TestCase):
         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')