pytest-typhoon-config
A pytest plugin that facilitates test parameter configuration at runtime
Features
- specify test parameters in a python module, just like any other
- choose which module to use at runtime
This way you can define different parameter sets for the same test suite and choose them at runtime.
Requirements
- pytest 6+
Installation
You can install pytest-typhoon-config via pip:
pip install pytest-typhoon-config
Usage
Create a test parameter definition file as a Python module, such as this:
# myparams.py
import numpy as np
a_list = [277.0, 278.0]
a_numpy_range = np.arange(58, 63, 0.2)
even_values = [v for v in range(20) if v % 2 == 0]
class StayConnected:
some_list = [22, 45, 85, 95]
some_param = 0.95
All module attributes will be injected at runtime in
tytest.config.runtime_settings.Config class. They will be available as
class-level attributes of Config. That means you can use them
like this:
from tytest.runtime_settings import Config as C
@python.mark.parametrize('param1', C.even_values)
def test_something(param1):
pass
In this example even_values variable will be initialized in myparams.py
module, and then injected into Config class. It is available in all test
code as Config.even_values.
This way you can create different python modules with the same variables, having different values, and then choose which module to use when invoking pytest. For example:
pytest --runconfig=myparams.py
The path of this file is evaluated at runtime.
Contributions
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-typhoon-config is
free and open source software.
Metadata
Release files for pytest-typhoon-config 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pytest-typhoon-config-1.0.0.tar.gz | 4.1 kB | Without provenance | Details |
Release files / pytest-typhoon-config-1.0.0.tar.gz
| Download URL | pytest-typhoon-config-1.0.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b9657018368f6044080c6fb9d708d6d303a06451a48c3c23415d36ce02e9d97
|
|
BLAKE2b-256 checksum How to use checksums |
823d6fb0d763d78bba9abbe35f3bc71bb57fe2013e37895d8e832d31dd6488c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for pytest-typhoon-config 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.