-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AssertionError when AUTO cases are requested outside a "test_" mo…
…dule (#320)
- Loading branch information
1 parent
ac7f3c3
commit 998429f
Showing
5 changed files
with
49 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pytest_cases import fixture, get_all_cases | ||
from pytest_cases.common_others import AUTO | ||
|
||
|
||
def mock_parameterization_target(): | ||
"""A callable to use as parametrization target.""" | ||
|
||
|
||
@fixture | ||
def get_all_cases_auto_fails(): | ||
"""Fail because we ask for AUTO cases in a non-'test_<...>' file.""" | ||
def _fail(): | ||
get_all_cases(mock_parameterization_target, cases=AUTO) | ||
return _fail |
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,7 @@ | ||
|
||
import pytest | ||
|
||
|
||
def test_get_all_cases_auto_raises(get_all_cases_auto_fails): | ||
with pytest.raises(ValueError): | ||
get_all_cases_auto_fails() |