cjsekl commented on a change in pull request #9841:
URL: https://github.com/apache/airflow/pull/9841#discussion_r455903989



##########
File path: tests/providers/postgres/hooks/test_postgres.py
##########
@@ -258,3 +258,16 @@ def 
test_insert_rows_replace_missing_replace_index_arg(self):
                 (2, "world",)]
         fields = ("id", "value")
         self.db_hook.insert_rows(table, rows, fields, replace=True)
+
+    @pytest.mark.backend("postgres")
+    def test_rowcount(self):
+        hook = PostgresHook()
+        input_data = ["foo", "bar", "baz"]
+
+        with hook.get_conn() as conn:
+            with conn.cursor() as cur:
+                cur.execute("CREATE TABLE {} (c VARCHAR)".format(self.table))
+                values = ",".join("('{}')".format(data) for data in input_data)
+                cur.execute("INSERT INTO {} VALUES {}".format(self.table, 
values))
+                conn.commit()
+                self.assertEqual(cur.rowcount, len(input_data))

Review comment:
       Ah, that should be `assert self.db_hook.log.info.call_count == 2`.
   Is that what you had in mind?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to