A simple plugin to detect missed pytest tags and markers"
Project description
A simple plugin for easy staging your Python3 project’s structure of PyTest tests. Make the repository with your tests more structured and beautiful 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)
Setting Allure titles for BDD tests
- Assertions rewriting with Allure steps including attachments for complex objects:
Pydantic BaseModels
dictionaries
lists
long strings.
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 –assert-steps option is compatible with simple pytest run loop and could be used for assertions rewriting with Allure steps.
The –bdd-titles option is compatible with simple pytest run loop and could be used for assertions rewriting with Allure steps.
The –bdd-format 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. For example:
- script:
pytest
pytest –staging –assert-steps –bdd-titles
pytest –bdd-format
Example of ‘pytest’ run with provided options:
$ pytest tests –staging –assert-steps –bdd-titles
======================= 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 ===================
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest-markers-presence-0.7.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9e57974bb78bd92d1a5cd310004eb2cb5780b5de74cde53999960e6fb55736f |
|
MD5 | bd59c81562585f3c72a78436e3fe46c1 |
|
BLAKE2b-256 | c65d1b008f490666fb6e30d81f27c4c3c0cc85125df2b57729d07b9edc2b6e9e |
Hashes for pytest_markers_presence-0.7.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7c8e50cc9db73439f37ac4b7cfdfdb52954b0b8d8330b0397b5bd05e34005ab |
|
MD5 | f9fb0df753b021d8bf5796655ce79f81 |
|
BLAKE2b-256 | 858d248b1f13c02f85f6d8a41bd31826755b563bf7c6dc8a27055c392be9bf83 |