Skip to main content

pytest plugin to test case doc string dls instructions

Project description

Pytest Allure DSL Plugin
========================

Installation
------------

```bash
pip install pytest-allure-dsl
```

Enable plugin
-------------

From command line

```bash
pytest -p pytest_allure_dsl --allure-dsl
```

From pytest.ini

```ini
[pytest]
addopts = -p pytest_allure_dsl --allure-dsl
```

From conftest.py

```python
pytest_plugins = ['pytest_allure_dsl']
```

By default allure dir is **./.allure**, you can change it with **--alluredir** option

Using allure labels and description
-----------------------------------

```python
"""
feature:
- common feature from module to test case functions
- can be re-writen from test case function docstring
"""


def test_example():
"""
story: test story string or story list
description: test description string
issue: issue for example
... and etc allure labels
"""
pass


class TestExample:
"""
feature:
- common feature from class to test case methods
- can be re-writen from test case method docstring
"""

def test_example(self):
"""
story: test story string or story list
description: test description string
"""
pass
```

What label can be re-writen
---------------------------

* feature
* issue
* host

Using allure steps from dsl
---------------------------

```python
def test_example(allure_dsl):
"""
steps:
1: step one
2: step two
"""
with allure_dsl.step(1):
pass

with allure_dsl.step(2):
pass
```

Using allure attachments
------------------------

```python
def test_example_file():
"""
attachments:
- title: jsonschema
file: jsonschemaes/schema.json
"""
pass


def test_example_content():
"""
attachments:
- title: simple text or something
content: some content
"""


def test_example_content_with_type():
"""
attachments:
- title: simple text or something
type: json
content: '{"hello": "world"}'
"""
pass
```

Advantages
----------
You can add custom keys for interpretation.
Plugin can be using for sync to jira zephyr, jira kanoah or another test case storage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-allure-dsl-0.0.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page