pytest_aws_config
Tiny Pytest plugin that mocks your AWS configuration in tests, making your tests independent of the configuration on the developer machine. In particular, it prevents your tests from accessing your AWS credentials.
Why is this useful?
Developers often use AWS configuration files to store (temporary) credentials to IAM users/roles. This is very useful to access the AWS account from the command line. But it also means that tests will run with these credentials.
> export AWS_PROFILE=production
> aws logs describe-log-groups # analyze some issue on production
> ... time passes ...
> ... write some code ...
> pytest tests # execute tests
Whoops! These tests just ran with access to your production account. Hopefully everything was correctly mocked or patched.
Installation
Just install this plugin with pip install pytest_aws_config. No configuration necessary.
What about functional tests?
Of course, some of your tests may actually need AWS credentials. You have two options:
- Disable the plugin when running functional tests:
pytest -p no:pytest_aws_config - Keep the plugin and use some other mechanism (e.g. a pytest fixture) to set the configuration in the test. Then your tests remain independent of the configuration on the developer machine.
Links
AWS documentation on configuration files and environment variables.
Metadata
Release files for pytest-aws-config 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_aws_config-0.1.0.tar.gz | 3.1 kB | Without provenance | Details for pytest_aws_config-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_aws_config-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_aws_config-0.1.0-py3-none-any.whl |
Total release size: 6.8 kB
Release files / pytest_aws_config-0.1.0.tar.gz
| Download URL | pytest_aws_config-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32bc2c943f664487a6a66781e8be557964013edce592e3ecffd9ba584a49dbc9
|
|
BLAKE2b-256 checksum How to use checksums |
16e797a40ae7306ca9437a3ab599b647ad9d38ecf19640e9a8f49422987cd01e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Release files / pytest_aws_config-0.1.0-py3-none-any.whl
| Download URL | pytest_aws_config-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3e868a5f135ccf78e083b94521953c7d8bd7951d7ebf1ed39edb81ffff4cc1b
|
|
BLAKE2b-256 checksum How to use checksums |
8d73bbdb8bea8d22262cd6ff599db7b7a1c422be462801bb598e9bf15ec6d6f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Security for pytest-aws-config 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.