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 details)

Uploaded Source

File details

Details for the file pytest-allure-dsl-0.0.2.tar.gz.

File metadata

  • Download URL: pytest-allure-dsl-0.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pytest-allure-dsl-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bd68141decd3fe1fbffaaaee41b776c4660364c058860dd1eb29908f1d2ca424
MD5 14ca072bd3aa9080f9aef3b19420a2b1
BLAKE2b-256 1f7e8c50cacb5ab24a257da097855deb01aae24a95c2681d2731cf14cb14ab5b

See more details on using hashes here.

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