dabla commented on code in PR #74600: URL: https://github.com/apache/airflow/pull/74600#discussion_r4307174502
########## providers/microsoft/azure/tests/unit/microsoft/azure/hooks/test_powerbi.py: ########## @@ -56,6 +61,184 @@ class TestPowerBIHook: + @pytest.mark.asyncio + @mock.patch.object(KiotaRequestAdapterHook, "run", autospec=True) + async def test_completed_enhanced_refresh_observation(self, mock_run, powerbi_hook): + fixture = json.loads( Review Comment: **[nit]** Load the fixture with the shared fixture loader. The other tests that read from `resources/` (for example `hooks/test_msgraph.py`) use `load_json_from_resources` from `tests_common.test_utils.file_loading`. That helper also opens the file as UTF-8. `Path.read_text()` with no `encoding` argument uses the locale's encoding instead ([ruff PLW1514](https://docs.astral.sh/ruff/rules/unspecified-encoding/)): ```python from os.path import dirname from tests_common.test_utils.file_loading import load_json_from_resources fixture = load_json_from_resources(dirname(__file__), "..", "resources", "powerbi_completed_refresh.json") ``` With this change, the `json` and `Path` imports can also go. -- 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]
