You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/06/21 02:03:04 UTC

[GitHub] [airflow] zhongjiajie commented on a change in pull request #5448: [AIRFLOW-4827] Remove compatible test for python 2

zhongjiajie commented on a change in pull request #5448: [AIRFLOW-4827] Remove compatible test for python 2
URL: https://github.com/apache/airflow/pull/5448#discussion_r296072721
 
 

 ##########
 File path: tests/hooks/test_hive_hook.py
 ##########
 @@ -460,23 +458,7 @@ def test_get_results_data(self):
         results = hook.get_results(query, schema=self.database)
         self.assertListEqual(results['data'], [(1, 1), (2, 2)])
 
-    @unittest.skipIf(NOT_ASSERTLOGS_VERSION < 3.4, 'assertLogs not support before python 3.4')
-    def test_to_csv_assertlogs(self):
-        hook = HiveServer2Hook()
-        query = "SELECT * FROM {}".format(self.table)
-        csv_filepath = 'query_results.csv'
-        with self.assertLogs() as cm:
-            hook.to_csv(query, csv_filepath, schema=self.database,
-                        delimiter=',', lineterminator='\n', output_header=True, fetch_size=2)
-            df = pd.read_csv(csv_filepath, sep=',')
-            self.assertListEqual(df.columns.tolist(), self.columns)
-            self.assertListEqual(df[self.columns[0]].values.tolist(), [1, 2])
-            self.assertEqual(len(df), 2)
-            self.assertIn('INFO:airflow.hooks.hive_hooks.HiveServer2Hook:'
-                          'Written 2 rows so far.', cm.output)
-
-    @unittest.skipIf(NOT_ASSERTLOGS_VERSION >= 3.4, 'test could cover by test_to_csv_assertLogs')
-    def test_to_csv_without_assertlogs(self):
 
 Review comment:
   You're right, remove wrong one.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services