Skip to main content
PyPI version Python versions See Build Status on Travis CI See Build Status on AppVeyor Downloads per month

A simple plugin for easy staging your Python3 project’s structure of PyTest tests. Make the repository with your tests structured with Allure ideology.

Features

  • Dynamical tests marking based on ‘tests’ subfolders

  • List not classified functions

  • List missed Allure BDD tags for test classes and functions (exclude fixtures and other incompatible objects)

  • Assertions rewriting with Allure steps including attachments for complex objects:
    • Pydantic BaseModels

    • dictionaries

    • lists

    • long strings.

  • Collecting of task tracker tickets with specified keyword

  • Enable setting of fail exitcode when all session tests were skipped

Installation

You can install “pytest-markers-presence” via pip from PyPI:

$ pip install pytest-markers-presence

Usage

The –staging option is compatible with simple pytest run loop and could be used for dynamical tests marking. The –staging-warnings option just enables warnings for –staging option.

The –assert-steps option is compatible with simple pytest run loop and could be used for assertions rewriting with Allure steps.

The –bdd-format and –feature-title option will not run your tests and it’s also sensible for errors in the pytest collection step. If you are using as part of you CI process the recommended way is to run it after the default test run.

The –all-skipped-fail option is compatible is simple pytest run loop and could be used for enabling of fail exitcode setting when all session tests were skipped.

For example:

script:
  • pytest

  • pytest –staging –all-skipped-fail

  • pytest –assert-steps

  • pytest –bdd-format

Examples of ‘pytest’ run with provided options:

$ pytest tests –staging –assert-steps

======================= test session starts =======================

(hidden for brevity)

==================== 1 passed in 0.51 seconds =====================

$ pytest –bdd-format

======================= test session starts =======================

(hidden for brevity)

You should create test class(es) for your test function(s): Test function: ‘test_function’, location: /path/to/test.py

You should set BDD tag ‘@allure.feature’ for your test class(es): Test class: ‘TestClass’, location: /path/to/file.py

You should set BDD tag ‘@allure.story’ for your test function(s): Test function: ‘test_case’, location: /path/to/file.py

================== no tests ran in 0.00 seconds ===================

$ pytest –all-skipped-fail

======================= test session starts =======================

(hidden for brevity)

test_fail_on_all_skipped_when_skip.py::test_case SKIPPED [100%]

Changed exitcode to FAILED because all tests were skipped.

======================== 1 skipped in 0.01s =======================

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, “pytest-markers-presence” is free and open source software

Issues

If you encounter any problems, please pytest-markers-presence along with a detailed description.

Release files for pytest-markers-presence 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-markers-presence 0.13.1
File Size Uploaded
pytest-markers-presence-0.13.1.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-markers-presence 0.13.1
File Interpreter ABI Platform
pytest_markers_presence-0.13.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 18.2 kB

Release files / pytest-markers-presence-0.13.1.tar.gz

Download URL pytest-markers-presence-0.13.1.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f9e2c3ade6bb21f23ab1ef58282da4d4e33549377177a17bae384e21cbad0f70
BLAKE2b-256 checksum
How to use checksums
8c367018eebf51731f1dd6b10c7ffb300ec2ae478e9f26f31a788b863e773761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release files / pytest_markers_presence-0.13.1-py2.py3-none-any.whl

Download URL pytest_markers_presence-0.13.1-py2.py3-none-any.whl
Size 8.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8e73548f63b94ba1e18934642d035ad51ef93d8564f13239fdc7ad33efdccf00
BLAKE2b-256 checksum
How to use checksums
d383c53f47294a1659e9e5d2564b5199a091ed2a440a27e89c62d7fed9dfafb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.13.1 This release

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page