File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,8 +61,10 @@ hooks = [
6161]
6262# Note that the `custom_exit_code` and `env` plugins may currently be unmaintained.
6363test = [
64+ " faker ==35.0.0" ,
6465 " hypothesis >=6.21.0,<6.122.8" ,
6566 " pytest >=7.2.0,<9.0.0" ,
67+ " pytest-cases ==3.8.6" ,
6668 " pytest-custom_exit_code ==0.3.0" ,
6769 " pytest-cov ==6.0.0" ,
6870 " pytest-doctestplus ==1.3.0" ,
Original file line number Diff line number Diff line change 11"""Test the Something module. Add more tests here, as needed."""
22
3+ import faker
34from hypothesis import given , strategies
5+ from pytest_cases import parametrize_with_cases
46
57from package .something import Something
68
79
810@given (strategies .booleans ())
9- def test_something (boolean : bool ) -> None :
10- """Test something here."""
11+ def test_something_hypothesis (boolean : bool ) -> None :
12+ """Test something here using Hypothesis."""
13+ assert Something .do_something (boolean ) is True
14+
15+
16+ def _case_boolean () -> bool :
17+ fake = faker .Faker ()
18+ return fake .pybool ()
19+
20+
21+ @parametrize_with_cases ("boolean" , cases = _case_boolean )
22+ def test_something_cases (boolean : bool ) -> None :
23+ """Test something here using Cases and Faker."""
1124 assert Something .do_something (boolean ) is True
You can’t perform that action at this time.
0 commit comments