Skip to content

Commit 339db77

Browse files
authored
add readme draft (fixes #23 via #35)
1 parent ada479c commit 339db77

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

allure-pytest/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Allure pytest plugin
2+
3+
## Changes
4+
5+
### Attachments
6+
You still can attach some content, but arguments order was changed:
7+
8+
pytest.allure.attach(*content*, name=*name*, attachment_type=*type*, extension=*extension*)
9+
10+
Where **type** is a mime string or one of presets like pytest.allure.attachment_type.XML. Extension is defined for all presets.
11+
12+
```
13+
def test_attach_from_test():
14+
pytest.allure.attach(xml_body)
15+
pytest.allure.attach(xml_body, name='my xml attachment', attachment_type=pytest.allure.attachment_type.XML)
16+
17+
```
18+
19+
Also you can attach files:
20+
pytest.allure.attach.file(*path to file*, name=*name*, attachment_type=*type*, extension=*extension*)
21+
22+
```
23+
def test_attach_from_test():
24+
pytest.allure.attach(xml_body)
25+
```
26+
27+
### Steps
28+
Step name formatting with function parameters is deprecated. All parameters of step function will be reported and shown in report.
29+
30+
##### Dynamic issues
31+
Current version doesn't support dynamic_issue, but you can do it with pytest fixtures:
32+
```python
33+
import pytest
34+
35+
36+
@pytest.fixture
37+
def dynamic_issue(request):
38+
def mark(link):
39+
request.node.add_marker(pytest.allure.issue(link))
40+
return mark
41+
42+
43+
@pytest.mark.parametrize('issue, result', [('ISSUE-1', True), ('ISSUE-2', False)])
44+
def test_dynamic_issue(dynamic_issue, issue, result):
45+
dynamic_issue(issue)
46+
assert result
47+
```

0 commit comments

Comments
 (0)