hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Refactor the test suite

Open maximlt opened this issue 2 years ago • 0 comments

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
  • [ ] Turn Param warnings into exceptions
  • [ ] Clean up files generated during the tests execution
  • [ ] Turn all warnings as exceptions?

maximlt avatar Oct 11 '23 15:10 maximlt