hvplot
hvplot copied to clipboard
Refactor the test suite
hvPlot's test suite needs a bit of love ❤️
- [ ] Move to pytest kind of tests over unittest when possible
- [ ] Rename test files to
test_xxx.py - Stop relying on side-effects
- [ ] There should be a way to undo side-effects on imports (e.g.
import hvplot.pandas), by implementingunpatchfunctions that de-register the accessors. - [ ] Once these
unpatchfunctions are implemented, the tests should be updated to always remove the side effects - [ ] The tests should be able to be executed in a random order (add a pytest plugin that does that automatically)
- [ ] Be careful with importing GeoViews, it also comes with some side effects as seen in https://github.com/holoviz/hvplot/pull/11130, e.g. updating the HoloViews registry and registering Compositors.
- [ ] There should be a way to undo side-effects on imports (e.g.
- [ ] hvPlot relies quite a lot on
try/except ImportErrorandif module_name in sys.modules, we should make sure that these code paths (succeeding or failing) are tested. This means that the test suite may have to be run multiple times, with and without some dependencies. That's the kind of stuff you define easily in tox. - [ ] Define a core suite of tests a data source should be able to pass, so it's easy to add tests for a newly supported data source. There's a little bit of that in
testcore.pyandtestplotting.py - [ ] Address warnings, if any (lol)
- [ ] Address xpass tests, if any
- [ ] Identify and optimize slow tests, if any
- [ ] Mark tests that make network calls, if any
- [ ] Identify untested data structures (streamz, cudf, etc.)
- [ ] Improve code coverage if there are low hanging fruits
- [ ] Turn Param warnings into exceptions
- [ ] Clean up files generated during the tests execution
- [ ] Turn all warnings as exceptions?