Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 1, modernize test suite #5954

Merged
merged 13 commits into from
Nov 22, 2023
Merged

Part 1, modernize test suite #5954

merged 13 commits into from
Nov 22, 2023

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Oct 25, 2023

This is part 1 of many parts, which will begin two tasks for the HoloViews test suite:

  1. Drop the standard library unittest framework with self.assertEqual and replace it with pytest.
    1.a. I plan to have an assert_element_equal for comparison of holoviews elements and then use assert, {np, pd, xr}.testing for types not directly HoloViews type. This will make it easier to see what is being tested at a glance.
    2.a. Be able to use fixtures. I have in this PR added bokeh_backend, mpl_backend, and plotly_backend.
  2. Make the test run in random order. Which then makes it possible to run with pytest-xdist. ref Test suite are sensitive to run order #5565

The focus of this PR has been updating the test, which saves files to disk; this has been done by using pytest tmp_path and minor updates to support pathlib for these methods.

The second part is test_statselements.py, where TestStatisticalCompositor was sensitive to the run order because it needed hv.renderer('matplotlib') to be called. I have updated the whole file to pytest.

@@ -44,6 +44,7 @@ def setUp(self):
except Exception:
raise SkipTest("IPython could not be started")

self.ip.displayhook.flush = lambda: None # To avoid gc.collect called in it
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not directly related to any failing test but gives a significant overhead when running the test suite.

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (994b9cd) 88.58% compared to head (387c0f9) 88.57%.

Files Patch % Lines
holoviews/tests/conftest.py 50.00% 12 Missing ⚠️
holoviews/element/comparison.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5954      +/-   ##
==========================================
- Coverage   88.58%   88.57%   -0.01%     
==========================================
  Files         315      315              
  Lines       65573    65576       +3     
==========================================
- Hits        58086    58085       -1     
- Misses       7487     7491       +4     
Flag Coverage Δ
ui-tests 23.27% <20.50%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hoxbro hoxbro mentioned this pull request Nov 22, 2023
@hoxbro hoxbro merged commit 982b51b into main Nov 22, 2023
10 checks passed
@hoxbro hoxbro deleted the fix_unsort branch November 22, 2023 08:52
@hoxbro hoxbro added the type: maintenance infrastructure and maintenance of CI label Nov 23, 2023
@hoxbro hoxbro mentioned this pull request May 25, 2024
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: component: testing type: maintenance infrastructure and maintenance of CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants