-
Notifications
You must be signed in to change notification settings - Fork 659
Rename example to test case in many places
#4631
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
Open
Liam-DeVoe
wants to merge
4
commits into
HypothesisWorks:master
Choose a base branch
from
Liam-DeVoe:rename-example
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
79346d8
rename "example" to "test case" in many places
Liam-DeVoe a86fac4
Merge branch 'master' into rename-example
Liam-DeVoe 30502c0
Merge remote-tracking branch 'upstream/master' into plait/review-hypo…
Liam-DeVoe df1acfd
add glossary, update more references
Liam-DeVoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| RELEASE_TYPE: minor | ||
|
|
||
| Hypothesis has historically referred to the single execution of a test function as an "example". However, we have in recent years tended to call a single execution a "test case" instead, which we think is a more precise and less overloaded term. | ||
|
|
||
| This release updates user-facing documentation, log messages, and error messages to use the "test case" terminology. | ||
|
|
||
| This is not a breaking change, as we have intentionally not changed any code APIs. For example, |settings.max_examples| has not been changed. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* dl gets used both for defining each top-level `.. autofunc` on a page (where we want vertical margsin) | ||
| and is wrapped around multiline signatures (where we don't). | ||
| If a dl is being used inside a .sig, that's a multiline signature; remove its margins. */ | ||
| .sig > dl { | ||
| margin-block-start: 0rem; | ||
| margin-block-end: 0rem; | ||
| } | ||
|
|
||
| /* with thanks to https://github.com/pradyunsg/furo/discussions/749 */ | ||
| .sig:not(.sig-inline) { | ||
| padding-left: 0.5em; | ||
| text-indent: 0; | ||
| } | ||
|
|
||
| /* override table width restrictions */ | ||
| /* thanks to https://github.com/readthedocs/sphinx_rtd_theme/issues/117#issuecomment-153083280 */ | ||
| @media screen and (min-width: 767px) { | ||
|
|
||
| .wy-table-responsive table td { | ||
| /* !important prevents the common CSS stylesheets from | ||
| overriding this as on RTD they are loaded after this stylesheet */ | ||
| white-space: normal !important; | ||
| } | ||
|
|
||
| .wy-table-responsive { | ||
| overflow: visible !important; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| /* disable autoscroll-to-target behavior | ||
| https://github.com/pradyunsg/furo/discussions/384#discussioncomment-2249243 */ | ||
| html { | ||
| scroll-behavior: auto; | ||
| } | ||
|
|
||
| /* | ||
| See https://github.com/HypothesisWorks/hypothesis/issues/4588 and | ||
| https://github.com/pradyunsg/furo/discussions/909. Once this is fixed in furo, | ||
| we can remove this. | ||
| */ | ||
|
|
||
| body[data-theme="dark"] .tooltip .tooltip-content { | ||
| background-color: var(--color-background-primary); | ||
| } | ||
|
|
||
| body[data-theme="dark"] .tooltip .arrow { | ||
| background: var(--color-background-primary); | ||
| } | ||
|
|
||
| /* | ||
| Furo also renders dark when the theme is "auto" (the default) and the OS | ||
| prefers dark, via this same media query. Cover that case too; see | ||
| https://github.com/HypothesisWorks/hypothesis/issues/4734. | ||
| */ | ||
| @media (prefers-color-scheme: dark) { | ||
| body:not([data-theme="light"]) .tooltip .tooltip-content { | ||
| background-color: var(--color-background-primary); | ||
| } | ||
|
|
||
| body:not([data-theme="light"]) .tooltip .arrow { | ||
| background: var(--color-background-primary); | ||
| } | ||
| } | ||
|
|
||
| a:has(> .std-term), | ||
| a:has(> .std-term):hover { | ||
| color: inherit; | ||
| text-decoration-color: currentColor; | ||
| text-decoration-style: dotted; | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new glossary page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| Glossary | ||
| ======== | ||
|
|
||
| User glossary | ||
| ------------- | ||
|
|
||
| Terms that are part of our public API. | ||
|
|
||
| .. glossary:: | ||
|
|
||
| explicit example | ||
| A |test case| from |@example|. | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| @example(42) | ||
| def f(n): | ||
| pass | ||
|
|
||
| Here, ``42`` is an explicit example. | ||
|
|
||
| Explicit examples are always run, in the |Phase.explicit| phase. Unlike Hypothesis-generated test cases, Hypothesis does not shrink explicit examples. | ||
|
|
||
| failing test case | ||
| A |test case| which causes the test to fail, usually by causing an exception to be raised. | ||
|
|
||
| minimal failing test case | ||
| The |failing test case| which has been fully shrunk (minimized) by Hypothesis. Hypothesis reports only the minimal failing test case to the user at the end of the test. | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| @given(st.integers()) | ||
| def f(n): | ||
| print("called with", n) | ||
| assert n < 10 | ||
|
|
||
| .. code-block:: none | ||
|
|
||
| called with 0 | ||
| called with 921 | ||
| called with 212 | ||
| ... | ||
| called with 10 | ||
| ... | ||
| Failing test case: f( | ||
| n=10, | ||
| ) | ||
|
|
||
| Here, each of ``921``, ``212``, and ``10`` are failing test cases. ``10`` is the minimal failing test case. | ||
|
|
||
| test case | ||
| The Hypothesis-generated input to a test function. | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| @given(st.integers()) | ||
| def f(n): | ||
| print("called with", n) | ||
| assume(n >= 0) | ||
|
|
||
| .. code-block:: none | ||
|
|
||
| called with 0 | ||
| called with 18588 | ||
| called with 672780074 | ||
| called with -32616 | ||
| ... | ||
|
|
||
| Here, the first four test cases are ``0``, ``18588``, ``672780074``, and ``-32616``. | ||
|
|
||
| "Test case" may also refer to the resulting execution of an input in a test function. Above, we might say that "the test case ``-32616`` failed the |assume|", referring to its entire execution. | ||
|
|
||
|
|
||
| Developer glossary | ||
| ------------------ | ||
|
|
||
| Terms that are part of our developer API. The developer API is intended for advanced users, researchers, and developers building on top of Hypothesis. | ||
|
|
||
| .. glossary:: | ||
|
|
||
| choice sequence | ||
| The underlying sequence of primitive values corresponding to a :term:`test case`. Conceptually, a choice sequence is the sequence of random choices made in the course of generating a value in a strategy. Each test case is represented internally as a choice sequence. | ||
|
|
||
| The exact representation is an implementation detail and depends on the strategy. For example, the value ``True`` from |st.booleans| is represented by the choice sequence ``[True]``, while the value ``[2, 42]`` from ``st.lists(st.integers())`` is represented by the choice sequence ``[True, 2, True, 42, False]``. | ||
|
|
||
| Currently, a choice sequence consists of booleans, integers, floats, strings, and bytes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,6 +102,7 @@ Technical API reference. | |
| reference/index | ||
| stateful | ||
| Extras <extras> | ||
| glossary | ||
| changelog | ||
|
|
||
| .. toctree:: | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combining our css files into one. The new content here is what I've highlighted here: removing blue links and adding underlines to glossary terms, for a more low-key look.