Formatting PyTest output for Azure Pipelines UI
Project description
Making Pytest easier to use with Microsoft Azure Pipelines.
Just run pytest with this plugin and see your test results in the Azure Pipelines UI!
Features:
Formats the PyTest output to show test docstrings and module names instead of just test case names in the Azure Pipelines UI.
Overloads the –junit-xml flag on execution with a default value
Uploads test results automatically, no need for a seperate test results upload command
Displays the number of failed tests if there were failures as an error message in the UI
Installation
You can install “pytest-azurepipelines” via pip from PyPI:
$ pip install pytest-azurepipelines
Usage
This plugin requires no configuration.
Here is an example of installing the plugin and running the tests.
- script: |
python -m pip install --upgrade pip
pip install pytest pytest-azurepipelines
pip install -e .
displayName: 'Install dependencies'
- script: |
python -m pytest tests/
displayName: 'pytest'
If you want to change the Azure Pipelines “Test Run Title”, you can provide the –test-run-title flag with the run title.
- script: |
pip install pytest pytest-azurepipelines
pytest tests/ --test-run-title="Windows Test with junitxml"
displayName: 'pytest with junitxml flag'
If you have long docstrings in your functions and want them to be shortened, you can use the –napoleon-docstrings flag:
- script: |
pip install pytest pytest-azurepipelines
pytest tests/ --test-run-title="Windows Test with junitxml" --napoleon-docstrings
Contributing
Contributions are very welcome.
License
Distributed under the terms of the MIT license, “pytest-azurepipelines” is free and open source software
Issues
If you encounter any problems, please file an issue 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-azurepipelines-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43eb4ede8c772798a083936183808bc58e35ded9a1a9412b44b83c54c47ca8b9 |
|
MD5 | 010a8d2c352d046b7fa4d38ffc36ca94 |
|
BLAKE2b-256 | c5054ac1571abce74fffdcfdb3344de5f25d9e22378dcf21a39b2ee2260380b5 |
Hashes for pytest_azurepipelines-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f730ce143a73c9639d22cd0a70b8760aa3200d6f5b920cad8dc852ea753a8f |
|
MD5 | 55fb7977e02c5ac35fba502a11e31b06 |
|
BLAKE2b-256 | 73293583c3f5857f323fcbca9604025c3b8b2f09114039fd88fbc7cf04e74c63 |