the test suite is too slow
See original GitHub issueThe test suite is getting to be quite slow. Here are the 20 slowest tests on my mac:
pytest --durations=20
18.96s call pvlib/tests/iotools/test_pvgis.py::test_get_pvgis_tmy_kwargs
16.32s call pvlib/tests/iotools/test_psm3.py::test_get_psm3_singleyear
14.82s setup pvlib/tests/test_forecast.py::test_process_data[HRRR]
8.12s call pvlib/tests/iotools/test_psm3.py::test_get_psm3_tmy
6.82s setup pvlib/tests/test_forecast.py::test_process_data[NDFD]
5.47s call pvlib/tests/iotools/test_pvgis.py::test_get_pvgis_tmy_epw
4.78s call pvlib/tests/iotools/test_pvgis.py::test_get_pvgis_tmy
3.99s setup pvlib/tests/test_forecast.py::test_process_data[RAP]
3.45s call pvlib/tests/iotools/test_srml.py::test_read_srml_month_from_solardat
3.20s call pvlib/tests/test_forecast.py::test_bad_kwarg_get_data
3.16s call pvlib/tests/test_forecast.py::test_bad_kwarg_get_processed_data
3.13s call pvlib/tests/test_forecast.py::test_how_kwarg_get_processed_data
3.13s setup pvlib/tests/test_forecast.py::test_process_data[NAM]
3.12s call pvlib/tests/test_forecast.py::test_vert_level
3.08s call pvlib/tests/test_forecast.py::test_datetime
2.98s call pvlib/tests/test_irradiance.py::test_get_extra_radiation_nrel_numba
2.85s call pvlib/tests/test_solarposition.py::test_spa_python_numba_physical
2.82s call pvlib/tests/test_solarposition.py::test_get_solarposition_deltat[None-nrel_numba]
2.73s setup pvlib/tests/test_spa.py::NumbaSpaTest::test_aberration_correction
2.69s call pvlib/tests/iotools/test_pvgis.py::test_get_pvgis_tmy_basic
I will work on the forecast tests. Any ideas for the iotools tests?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How Slow Is Too Slow to Run Your Tests?
You might be wondering if your tests are running too slow compared to others. Here's how you can decide for yourself.
Read more >9 Ways To Make Slow Tests Faster
By that measure, a test suite taking longer than the time it takes to stretch your legs and grab a cup of coffee...
Read more >Running test suite/ test suites collection is super slow
I notice since yesterday when im running a test suite or test suites collection it is extremly slow, there are like 3 scenarios:...
Read more >Fast fixes for slow tests: How to unclog your CI pipeline
It's common that slow tests are overloaded—they try to do too many things. By paring down the steps each test has to perform,...
Read more >Why first N test suites are extremely slow? · Issue #7261
When I run jest tests first N test suites are running extremely slow remaining are blazing fast. What is the reason, spawning workers?...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

One idea is to mock the network calls by default [1] but leave the option to perform them when specifically requested [2].
[1] https://requests-mock.readthedocs.io/en/latest/pytest.html [2] https://docs.pytest.org/en/2.9.1/example/simple.html#control-skipping-of-tests-according-to-command-line-option
(edit – the [2] link above is super out of date, not sure why it showed up for me on google. a little irrelevant since pytest-remotedata does the same thing anyway)
I was a little scared of that too, but just mentioned it as a remote possibility, nuclear option, thx
I think a wiki or doc page in contribution guidelines (maybe I missed this) to clarify expected testing patterns and recommended PR test procedures could be helpful to align everyone