kaxil commented on a change in pull request #9973:
URL: https://github.com/apache/airflow/pull/9973#discussion_r614171910



##########
File path: tests/models/test_renderedtifields.py
##########
@@ -172,7 +172,11 @@ def test_delete_old_records(self, rtif_num, num_to_keep, 
remaining_rtifs, expect
         assert rtif_num == len(result)
 
         # Verify old records are deleted and only 'num_to_keep' records are 
kept
-        with assert_queries_count(expected_query_count):
+        # For other DBs,an extra query is fired in 
RenderedTaskInstanceFields.delete_old_records
+        expected_query_count_based_on_db = (expected_query_count + 1, 
expected_query_count)[
+            session.bind.dialect.name in ["postgresql", "sqlite", "mysql"] or 
expected_query_count == 0
+        ]

Review comment:
       ```suggestion
           expected_query_count_based_on_db = expected_query_count + 1 if 
session.bind.dialect.name == ["mssql"] else expected_query_count
   ```




-- 
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