pytest_apiver
Pytest plugin helping to test packages implementing ApiVer.
Usage
Assuming your package exposes v1, v2, ... ApiVer interfaces, i.e. has structure like this:
my_package/
__init__.py
v1/
__init__.py
...
_v3/
__init__.py
You can configure to run apiver-aware tests against it using pyproject.toml:
[tool.pytest.ini_options]
target_package_name = "my_package"
Then you can write tests like this:
@pytest.mark.apiver(from_ver=2, to_ver=3)
def test_run_for_apiver_ver_2_3(apiver_module):
assert apiver_module.func()
Which will run test against my_package.v2.func() and my_package.v3.func() respectively.
For non-flat package structure, you can use auto-magical getter doing imports of submodules built into apiver_module fixture, e.g.:
@pytest.mark.apiver(from_ver=2, to_ver=2)
def test_func__v2(apiver_module):
assert apiver_module.utils.func() # equivalent to my_package.v2.utils.func()
Versioning
This package uses Semantic Versioning.
TL;DR you are safe to use compatible release version specifier ~=MAJOR.MINOR in your pyproject.toml or requirements.txt.
Internal packages, i.e. prefixed by pytest_apiver._ do not share these guarantees and may change in a backwards-incompatible way at any time even in patch releases.
Development
Pre-requisites:
Ideally, you should run nox -t format lint before every commit to ensure that the code is properly formatted and linted.
Before submitting a PR, make sure that tests pass as well, you can do so using:
nox -t check # equivalent to `nox -t format lint test`
If you wish to install dependencies into .venv so your IDE can pick them up, you can do so using:
pdm install --dev
Release process
Run nox -s make_release -- X.Y.Z where X.Y.Z is the version you're releasing and follow the printed instructions.
Metadata
Release files for pytest-apiver 0.1.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 | Actions |
|---|---|---|---|---|
| pytest_apiver-0.1.0.tar.gz | 6.6 kB | Without provenance | Details for pytest_apiver-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_apiver-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_apiver-0.1.0-py3-none-any.whl |
Total release size: 11.5 kB
Release files / pytest_apiver-0.1.0.tar.gz
| Download URL | pytest_apiver-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
105023e626a3e3e59c59efb3f4268245b09ddfb3d8e627f67e4f411d77642e67
|
|
BLAKE2b-256 checksum How to use checksums |
8f712205f73d5849b3941e2018e5ff4a090776a3aad82eb4eb18cf62cfbe48f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / pytest_apiver-0.1.0-py3-none-any.whl
| Download URL | pytest_apiver-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc86ec3de77506a26aa232858f94c5bf397b1a0798ba7c0772061017119f3420
|
|
BLAKE2b-256 checksum How to use checksums |
85486df9924919148dd6a10a67a5e253041c705c481c669c9c3ce6f40d262a3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for pytest-apiver 0.1.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.