-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): add the pytest-cases package and a simple example of how …
…to use it
- Loading branch information
1 parent
0eea8db
commit 0392ece
Showing
2 changed files
with
10 additions
and
2 deletions.
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
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
"""Test the Something module. Add more tests here, as needed.""" | ||
|
||
from hypothesis import given, strategies | ||
from pytest_cases import parametrize | ||
|
||
from package.something import Something | ||
|
||
|
||
@given(strategies.booleans()) | ||
def test_something(boolean: bool) -> None: | ||
"""Test something here.""" | ||
def test_something_hypothesis(boolean: bool) -> None: | ||
"""Test something here using Hypothesis.""" | ||
assert Something.do_something(boolean) is True | ||
|
||
|
||
@parametrize("boolean", [True, False]) | ||
def test_something_cases(boolean: bool) -> None: | ||
"""Test something here using Cases.""" | ||
assert Something.do_something(boolean) is True |