Skip to content

Document how to run the Hypothesis property tests - #1525

Merged
asvetlov merged 1 commit into
aio-libs:masterfrom
asvetlov:document-hypothesis-test-leg
Sep 23, 2026
Merged

asvetlov merged 1 commit into
aio-libs:masterfrom
asvetlov:document-hypothesis-test-leg

Conversation

@asvetlov

Copy link
Copy Markdown
Member

What do these changes do?

AGENTS.md described how to run the suite without mentioning that the
property tests under tests/test_hypothesis_*.py are not part of it.
pytest.ini sets -m "not hypothesis", so a plain make test skips
them and reports a pass, and make install-dev does not install
hypothesis either, since the pin lives in its own
requirements/pytest-hypothesis.txt. Someone following the file as
written would believe they had run the whole suite.

The Tests section now records the marker override, the separate
requirements file and the reason it is separate, and the fact that one
-m hypothesis run already covers both backends. Documentation only.

Are there changes in behavior for the user?

No.

Is it a substantial burden for the maintainers to support this?

No.

Related issue number

None. Follow-up to #1523, which fixed the pure-Python invocation in the
same section.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist — N/A, documentation-only change
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt — N/A, no such file in this repo
  • Add a new news fragment into the CHANGES/ folder
  • make doc-spelling passes and any new technical words are added to docs/spelling_wordlist.txt

Drafted with Claude Code (Opus 5); reviewed by @asvetlov.

Agent run details (optional, for reviewers)

Claims checked against the tree rather than assumed.

make install-dev really does not bring hypothesis in; a fresh venv
built from requirements/dev.txt has no hypothesis module:

$ pip install -r requirements/dev.txt && pip install -e .
$ python -c "import hypothesis"
ModuleNotFoundError: No module named 'hypothesis'

The documented commands, run verbatim on CPython 3.14.7t:

$ pip install -r requirements/pytest-hypothesis.txt
$ pytest -q -m hypothesis
143 passed, 4 skipped, 2210 deselected in 76.68s

That a single run covers both backends was confirmed by collection,
which yields -c and -py ids together:

$ pytest -m hypothesis --collect-only | grep -oE "\[(cs|ci)?-?(c|py)\]" | sort | uniq -c
      5 [c]
     27 [ci-c]
     27 [ci-py]
     27 [cs-c]
     27 [cs-py]
      5 [py]

The note on why the pin is kept out of requirements/pytest.txt, and
the two CI jobs, are taken from the existing comments on the
hypothesis-gil and hypothesis-freethreading jobs in
.github/workflows/ci-cd.yml.

$ make doc-spelling
build succeeded.

pre-commit run over the changed files passes.

@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Sep 22, 2026
@asvetlov
asvetlov force-pushed the document-hypothesis-test-leg branch from 32ea456 to 8536b36 Compare September 22, 2026 22:38
@asvetlov
asvetlov marked this pull request as ready for review September 22, 2026 22:40
@asvetlov
asvetlov requested a review from webknjaz as a code owner September 22, 2026 22:40
@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge.

Reviews (3) · Last reviewed commit: "Document how to run the Hypothesis prope..."

@codspeed

codspeed Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 310 untouched benchmarks


Comparing asvetlov:document-hypothesis-test-leg (c89b6f4) with master (3e98f6f)

Open in CodSpeed

@asvetlov
asvetlov force-pushed the document-hypothesis-test-leg branch from 8536b36 to aace6eb Compare September 22, 2026 22:56
Comment thread AGENTS.md Resolved
@greptile-apps

This comment has been minimized.

pytest.ini sets -m "not hypothesis", so a plain test run skips
tests/test_hypothesis_*.py without reporting it, and the pin is not
part of the dev requirements. Record the marker override, the separate
requirements file, and the fact that a single run already covers both
backends.
@asvetlov
asvetlov force-pushed the document-hypothesis-test-leg branch from aace6eb to c89b6f4 Compare September 23, 2026 07:31
@asvetlov
asvetlov merged commit c169502 into aio-libs:master Sep 23, 2026
61 checks passed
@asvetlov
asvetlov deleted the document-hypothesis-test-leg branch September 23, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant