Skip to content

Call super().__init__() in st.SearchStrategy subclasses #10543

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

spencerkclark
Copy link
Member

In the next version of hypothesis subclasses of hypothesis.strategies.SearchStrategy will be required to call super().__init__() in their __init__ method (HypothesisWorks/hypothesis#4473). This PR addresses this in the two subclasses in our codebase: CFTimeStrategy and CFTimeStrategyISO8601.

Apparently this kind of subclassing is not actually part of the public API (link), so maybe we should adjust the approach here long term, but this at least gets the tests passing for now.

@github-actions github-actions bot added topic-testing topic-hypothesis Strategies or tests using the hypothesis library labels Jul 17, 2025
@spencerkclark spencerkclark added the run-slow-hypothesis Run slow hypothesis tests label Jul 17, 2025
@spencerkclark
Copy link
Member Author

Thanks for the quick review @dcherian.

@spencerkclark spencerkclark merged commit 57b3c17 into pydata:main Jul 17, 2025
46 of 47 checks passed
@spencerkclark spencerkclark deleted the fix-hypothesis-test branch July 17, 2025 10:35
dcherian added a commit to dcherian/xarray that referenced this pull request Jul 17, 2025
* main:
  Fix convert calendar with different dimension name (pydata#10544)
  Fix kerchunk error in docs build (pydata#10545)
  Call super().__init__() in st.SearchStrategy subclasses (pydata#10543)
dcherian added a commit to jsignell/xarray that referenced this pull request Jul 18, 2025
* main: (94 commits)
  Restructure API documentation into organized sections (pydata#10540)
  Fix convert calendar with different dimension name (pydata#10544)
  Fix kerchunk error in docs build (pydata#10545)
  Call super().__init__() in st.SearchStrategy subclasses (pydata#10543)
  CI: update actions location (pydata#10529)
  meta: Fix labeler topic-documentation (pydata#10524)
  drop_vars: use emit_user_level_warning (pydata#10528)
  Pydap flaky tests (pydata#10525)
  Remove test skip (pydata#10523)
  Improve warning message and tests for timedelta decoding (pydata#10508)
  Add dev whats-new (pydata#10522)
  Add release notes for v2025.07.1 (pydata#10520)
  Updates for Zarr 3 Dtypes (pydata#10456)
  Update Custom Indexes section in api.rst (pydata#10517)
  Expression not assigned (pydata#10507)
  Raise if `Index.create_variables` returns more variables than passed in through `set_xindex` (pydata#10503)
  Allow setting (or skipping) new indexes in open_dataset (pydata#8051)
  doc: add Pandas(Multi)Index to api reference (pydata#10515)
  Update pre-commit hooks (pydata#10510)
  Update pre-commit ruff legacy alias (pydata#10511)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-slow-hypothesis Run slow hypothesis tests topic-hypothesis Strategies or tests using the hypothesis library topic-testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⚠️ Nightly upstream-dev CI failed ⚠️
2 participants