satpy icon indicating copy to clipboard operation
satpy copied to clipboard

slow test in `TestParallaxCorrectionSceneLoad` due to network access

Open gerritholl opened this issue 3 months ago • 2 comments

Describe the bug

The test TestParallaxCorrectionSceneLoad.test_no_compute in modifier_tests/test_parallax.py takes more than 8 seconds. This is due to network access to get a TLE:

https://github.com/pytroll/satpy/blob/6d843f67ac8bde26f437101ed7a82541b10d625c/satpy/utils.py#L425-L433

The test should provide a toy TLE in some way so that no network access is performed.

To Reproduce

pytest --durations=10 test_parallax.py

Expected behavior

Ideally, all tests should be fast (less than 100 ms at most).

Actual results

9.06s call     satpy/tests/modifier_tests/test_parallax.py::TestParallaxCorrectionSceneLoad::test_no_compute

Environment Info:

  • Satpy Version: main

Additional context

The automatic downloading is due to github.com/pytroll/pyorbital/pull/210, but after that one is fixed we still need to fix this test to provide the TLEs somehow.

gerritholl avatar Oct 13 '25 11:10 gerritholl

The easy fix for the test is to write TLE data to a file and point TLES environment variable to it.

pnuu avatar Oct 13 '25 11:10 pnuu

https://pyorbital.readthedocs.io/en/latest/#tle-files

pnuu avatar Oct 13 '25 11:10 pnuu