-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing fixtures in report when using lazy_fixture (via #548)
- Loading branch information
Showing
4 changed files
with
59 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
Empty file.
56 changes: 56 additions & 0 deletions
56
allure-pytest/test/integration/pytest_lazy_fixture/pytest_lazy_fixture_test.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,56 @@ | ||
import allure | ||
from hamcrest import assert_that | ||
from allure_commons_test.report import has_test_case | ||
from allure_commons_test.container import has_container | ||
from allure_commons_test.container import has_before | ||
|
||
|
||
@allure.feature("Integration") | ||
def test_lazy_fixture(executed_docstring_source): | ||
""" | ||
>>> import pytest | ||
... from pytest_lazyfixture import lazy_fixture | ||
>>> @pytest.fixture | ||
... def my_lazy_fixture(): | ||
... pass | ||
>>> @pytest.mark.parametrize('param', [lazy_fixture('my_lazy_fixture')]) | ||
... def test_lazy_fixture_example(param): | ||
... pass | ||
""" | ||
|
||
assert_that(executed_docstring_source.allure_report, | ||
has_test_case("test_lazy_fixture_example", | ||
has_container(executed_docstring_source.allure_report, | ||
has_before("my_lazy_fixture") | ||
), | ||
) | ||
) | ||
|
||
|
||
@allure.feature("Integration") | ||
def test_nested_lazy_fixture(executed_docstring_source): | ||
""" | ||
>>> import pytest | ||
... from pytest_lazyfixture import lazy_fixture | ||
>>> @pytest.fixture | ||
... def my_lazy_fixture(): | ||
... pass | ||
>>> @pytest.fixture(params=[lazy_fixture('my_lazy_fixture')]) | ||
... def my_ordinary_fixture(): | ||
... pass | ||
>>> def test_nested_lazy_fixture_example(my_ordinary_fixture): | ||
... pass | ||
""" | ||
|
||
assert_that(executed_docstring_source.allure_report, | ||
has_test_case("test_nested_lazy_fixture_example", | ||
has_container(executed_docstring_source.allure_report, | ||
has_before("my_lazy_fixture") | ||
), | ||
) | ||
) |
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