pytest-argus-server
A pytest plugin that provides a running Argus API server for tests.
This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.
Features
Fixtures that will provide tests with a running Argus API server (using Docker Compose)
Requirements
Installation
You can install “pytest-argus-server” via pip from PyPI:
$ pip install pytest-argus-server
Usage
Installing this package will automatically make it available in pytest.
Extra pytest command line arguments
By default, this plugin will run the latest available Argus server Docker image. The actually deployed version can be controlled by adding the --argus-version command line option to pytest:
pytest --argus-version=2.7.0 tests/
Provided fixtures
The main fixtures provided by this plugin are the session-scoped argus_api_url and argus_source_system_token.
argus_api_url
When used by a test, this will ensure an Argus server is running and ready to take requests. It returns the base URL of the running API:
def test_url_should_be_as_expected(argus_api_url):
assert argus_api_url == "http://127.0.0.1:8000/api/v2/"
argus_source_system_token
This token will create a test source system and return a valid API token for accessing the API as this test source.
def test_fetch_incidents(argus_api_url, argus_source_system_token):
assert requests.get(
f"{argus_api_url}/incidents/",
headers={"Authorization": f"Token {argus_source_system_token}"}
).status_code == 200
Bugs
The port number of the launched API server is hard-coded to 8000.
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.
All code needs to be formatted and linted by ruff. The pre-commit tool is used to enforce code styles at commit-time. To enable the pre-commit hooks in your repository run:
$ pre-commit install
License
Distributed under the terms of the Apache Software License 2.0 license, “pytest-argus-server” is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Metadata
Release files for pytest-argus-server 0.4.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_argus_server-0.4.0.tar.gz | 21.4 kB | Without provenance | Details for pytest_argus_server-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_argus_server-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_argus_server-0.4.0-py3-none-any.whl |
Total release size: 31.9 kB
Release files / pytest_argus_server-0.4.0.tar.gz
| Download URL | pytest_argus_server-0.4.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f2d7c9c1d8a2abd0856fb8a9c604f9d9da4f0a39f021aaf3fbf8db652bd4fcd
|
|
BLAKE2b-256 checksum How to use checksums |
9c710216ba0745e0d72e97800c60fbd7f30f685c00d57416c43cb0759a28017b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pytest_argus_server-0.4.0-py3-none-any.whl
| Download URL | pytest_argus_server-0.4.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56b964fd6388d7928607872b777e70d0cbcae75daebcc66625660dabc9ae5e95
|
|
BLAKE2b-256 checksum How to use checksums |
47df37b85b7a3a86ab9a843c522d7fc00d2fdec7d6358c703783695ad7b7e48c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for pytest-argus-server 0.4.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.