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 2022/12/01 18:41:32 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #28040: Migrate google provider cloud utils tests from `unittests` to `pytest`

Taragolis commented on code in PR #28040:
URL: https://github.com/apache/airflow/pull/28040#discussion_r1037451071


##########
tests/providers/google/cloud/utils/test_credentials_provider.py:
##########
@@ -131,35 +128,21 @@ def test_provide_gcp_conn_and_credentials(self, mock_builder):
         assert os.environ[CREDENTIALS] == ENV_VALUE
 
 
-class TestGetGcpCredentialsAndProjectId(unittest.TestCase):
-    @classmethod
-    def setUpClass(cls):
-        cls.test_scopes = _DEFAULT_SCOPES
-        cls.test_key_file = "KEY_PATH.json"
-        cls.test_project_id = "project_id"
-
-    @contextmanager
-    def assert_no_logs(self, name, level):
-        with self.assertLogs(level=level) as logs:
-            # AssertionError will raise if we do not create dummy record here
-            logging.log(level=logging.getLevelName(level), msg="nothing")
-            yield
-        records = [log_record for log_record in logs.records if log_record.name == name]
-        if not records:
-            return
-        raise AssertionError(f"Did not expect any log message from logger={name!r}, but got: {records}")

Review Comment:
   Not required anymore, use `caplog` fixture instead of this workaround



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org