-
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.
Fixed
fixture 'self' not found
issue when @fixture
was used to de…
…corate a class method not explicitly depending on `request`. Fixed #182
- Loading branch information
Sylvain MARIE
committed
Feb 19, 2021
1 parent
672aacf
commit 71fb1bc
Showing
4 changed files
with
32 additions
and
4 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
27 changes: 27 additions & 0 deletions
27
pytest_cases/tests/pytest_extension/issues/test_issue_182.py
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,27 @@ | ||
import pytest | ||
from pytest_cases import fixture | ||
|
||
|
||
class TestMethod: | ||
@pytest.fixture | ||
def pytest_fxt(self): | ||
return "Hello" | ||
|
||
def test_with_pytest(self, pytest_fxt): | ||
# succeeds | ||
assert pytest_fxt == "Hello" | ||
|
||
@fixture | ||
def cases_fxt(self): | ||
return "Hello" | ||
|
||
def test_with_cases(self, cases_fxt): | ||
# raises an error with regards to 'self' | ||
assert cases_fxt == "Hello" | ||
|
||
|
||
def test_synthesis(module_results_dct): | ||
assert list(module_results_dct) == [ | ||
'test_with_pytest', | ||
'test_with_cases' | ||
] |