Labrea Test
Utilities for testing code written with labrea
Installation
labrea-test is available for install via pip.
pip install labrea-test
Alternatively, you can install the latest development version from GitHub.
pip install git+https://github.com/8451/labrea-test@develop
Usage
During testing, you may want to mock a certain dataset (or other Evaluatable) to known value.
This can be done using the labrea_test.Mock context manager, which ensures that at the end
of the block, any mocking is torn down.
import labrea_test
from labrea import dataset
@dataset
def foo() -> str:
return "foo"
def test_foo():
with labrea_test.Mock() as mock:
mock(foo, "bar")
assert foo() == "bar"
assert foo() == "foo"
Mock can be used to mock any Evaluatable object, and can take a plain value or another
Evaluatable object as the value to mock to.
@dataset
def bar() -> str:
return "bar"
def test_foo():
with labrea_test.Mock() as mock:
mock(foo, bar)
assert foo() == "bar"
assert foo() == "foo"
Contributing
If you would like to contribute to labrea-test, please read the Contributing Guide.
Changelog
A summary of recent updates to labrea-test can be found in the Changelog.
Maintainers
| Maintainer | |
|---|---|
| Austin Warner | austin.warner@8451.com |
| Michael Stoepel | michael.stoepel@8451.com |
Links
- Report a bug or request a feature: https://github.com/8451/labrea-test/issues/new/choose
- Documentation: https://8451.github.io/labrea-test
Metadata
Release files for labrea-test 0.0.1
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 |
|---|---|---|---|---|
| labrea_test-0.0.1.tar.gz | 201.1 kB | With provenance | Details for labrea_test-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| labrea_test-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for labrea_test-0.0.1-py3-none-any.whl |
Total release size: 206.6 kB
Release files / labrea_test-0.0.1.tar.gz
| Download URL | labrea_test-0.0.1.tar.gz |
|---|---|
| Size | 201.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d05801bd6375e83caa9fdb3bec440f43973177a96b09c2fc580ce9a090ace110
|
|
BLAKE2b-256 checksum How to use checksums |
a73c1d9665ff4b83e810958e8b0fc1924c14b29fe609dfef176bb6ec24a2eb35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2025.
Transparency logRelease files / labrea_test-0.0.1-py3-none-any.whl
| Download URL | labrea_test-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85358eb2a4749bede32f7e4f6a67a82b12917f1af48534ce4c2e2fe5b896a285
|
|
BLAKE2b-256 checksum How to use checksums |
85a8b5ebb00b3828086a692cc2949067180bd82f743a3b36a66e173745bafaff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2025.
Transparency logSecurity for labrea-test 0.0.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for labrea_test-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2025.
Transparency logA 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.