-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3802 from Zac-HD/testcase-subclass-settings
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,18 @@ | ||
RELEASE_TYPE: patch | ||
|
||
This patch supports assigning ``settings = settings(...)`` as a class attribute | ||
on a subclass of a ``.TestCase`` attribute of a :class:`~hypothesis.stateful.RuleBasedStateMachine`. | ||
Previously, this did nothing at all. | ||
|
||
.. code-block: python | ||
# works as of this release | ||
class TestMyStatefulMachine(MyStatefulMachine.TestCase): | ||
settings = settings(max_examples=10000) | ||
# the old way still works, but it's more verbose. | ||
MyStateMachine.TestCase.settings = settings(max_examples=10000) | ||
class TestMyStatefulMachine(MyStatefulMachine.TestCase): | ||
pass | ||
Thanks to Joey Tran for reporting these settings-related edge cases in stateful testing. |
This file contains 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 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