forked from allure-framework/allure-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not attach empty logs (via allure-framework#373)
- Loading branch information
1 parent
6ebccee
commit b317e4d
Showing
3 changed files
with
44 additions
and
10 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
17 changes: 11 additions & 6 deletions
17
allure-pytest/test/acceptance/attachment/attachment_parametrized_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 |
---|---|---|
@@ -1,21 +1,26 @@ | ||
import pytest | ||
from hamcrest import assert_that | ||
from hamcrest import all_of | ||
from hamcrest import has_property, has_value | ||
from hamcrest import contains_string | ||
from allure_commons_test.report import has_test_case | ||
from allure_commons_test.result import has_attachment | ||
|
||
|
||
@pytest.mark.parametrize("param", ["first", "second"]) | ||
def test_parametrized_attachment(executed_docstring_source, param): | ||
""" | ||
>>> import pytest | ||
>>> import allure | ||
>>> @pytest.mark.parametrize("param", ["first", "second"]) | ||
... def test_parametrized_attachment_example(param): | ||
... assert param | ||
... allure.attach(param) | ||
""" | ||
|
||
assert_that(executed_docstring_source.allure_report, | ||
has_test_case("test_parametrized_attachment_example[{param}]".format(param=param), | ||
has_attachment() | ||
) | ||
) | ||
all_of( | ||
has_test_case("test_parametrized_attachment_example[{param}]".format(param=param)), | ||
has_property("attachments", | ||
has_value(contains_string(param)) | ||
) | ||
)) |
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