holoviz / holoviz/hvplot

Refactor the test suite

Open
#1,168 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

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 implementing `unpatch` functions that de-register the accessors.
- [ ] Once these `unpatch` functions 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.
- [ ] hvPlot relies quite a lot on `try/except ImportError` and `if 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.py` and `testplotting.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
- [x] Turn Param warnings into exceptions
- [ ] Clean up files generated during the tests execution
- [ ] Turn all warnings as exceptions?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.