dstandish commented on code in PR #26973:
URL: https://github.com/apache/airflow/pull/26973#discussion_r991529302
##########
tests/providers/google/cloud/utils/test_credentials_provider.py:
##########
@@ -349,7 +367,7 @@ def test_disable_logging(self, mock_default, mock_info,
mock_file):
key_path='KEY.json',
disable_logging=True,
)
- assert logs.output == ['DEBUG:root:nothing']
+ assert_no_logs(logs.records)
Review Comment:
then the code becomes this:
```python
# assert no logs
with self.assert_no_logs(name=logger_name, level="DEBUG") as logs:
get_credentials_and_project_id(disable_logging=True)
# assert no debug logs emitted from get_credentials_and_project_id
with self.assert_no_logs(name=logger_name, level="DEBUG") as logs:
get_credentials_and_project_id(
keyfile_dict={'private_key': 'PRIVATE_KEY'},
disable_logging=True,
)
# assert no debug logs emitted from get_credentials_and_project_id
with self.assert_no_logs(name=logger_name, level="DEBUG") as logs:
get_credentials_and_project_id(
key_path='KEY.json',
disable_logging=True,
)
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]