Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
While executing unit tests in scope of github testing workflow, some requests to Open-Meteo API take a lot of time, and then fall with timeout (probably due to large timespans or authorization issues). It is considered to be not a good practice at all - to do network requests inside of unit tests. In scope of this fix, calls to Open-Meteo API are mocked with a fixture, which leads to smaller test execution time.
It was needed to do changes in
quartz_solar_forecast/data.py
andquartz_solar_forecast/forecasts/v2.py
, so that they both use a wrapper fromquartz_solar_forecast/weather/open_meteo.py
, which made it possible to mock data requesting-related method. Also it allowed to avoid some of the code duplication.Fixes #231
How Has This Been Tested?
Workflow tests job for unit tests succeeds in fork branch, test execution time is about 3 minutes now.

Coverage changed slightly (59%->58%), seems to be due to amount of codelines decreasing 🙂

Job for integration tests is failing, but I guess it wasn't working already.
Checklist: