pytest-hwcontract
Judge hardware captures against hwcontract contracts as ordinary pytest tests. A FAIL, MARGINAL or MISSING edge is a failing test with the rendered verdict table in the message, so JUnit and CI show exactly which edge failed, the measured value, and the delta.
pip install pytest-hwcontract
Use
def test_strip(hwcontract):
obs = hwcontract.capture_csv("captures/strip.csv", samplerate=24_000_000)
hwcontract.timing("ws2812b", obs) # bundled contract by name
hwcontract.timing("contracts/esc.contract.yaml", obs) # or a path
def test_boot(hwcontract):
hwcontract.serial("boot", open("boot.log").read())
Contracts resolve as: an existing path, then --hwcontract-root <dir>, then
the 28 contracts bundled with hwcontract by name.
A failing verdict reads like the CLI's:
Failed: hwcontract verdict FAIL (4f2b9c1a0e7d)
edge typ actual status hint
------------------------------------------------------------
T1L 450 583 MARGINAL only 17ns from max; nudge toward typ 450
Why marginal fails
In spec but rail-hugging works on your bench and dies in the field. The judge fails the test on MARGINAL by design; that is the whole point of gating CI on wire-level measurements.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_hwcontract-0.1.1.tar.gz.
File metadata
- Download URL: pytest_hwcontract-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a81f6596022a1835289cdf12a540272630cbbcc71e90559b50cf8a2e8435eb52
|
|
| MD5 |
83a35f89cec4a46f02842c692e27ad2d
|
|
| BLAKE2b-256 |
32af4202f15d8addace509777a497c76b77fd5a8ba1b72819c1b9b48848468ca
|
Provenance
The following attestation bundles were made for pytest_hwcontract-0.1.1.tar.gz:
Publisher:
plugin.yml on MohibShaikh/hwcontract
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_hwcontract-0.1.1.tar.gz -
Subject digest:
a81f6596022a1835289cdf12a540272630cbbcc71e90559b50cf8a2e8435eb52 - Sigstore transparency entry: 2581982876
- Sigstore integration time:
-
Permalink:
MohibShaikh/hwcontract@e9bf3cfd75bbad5e644718b4fa75fe161a064c07 -
Branch / Tag:
refs/tags/pytest-v0.1.1 - Owner: https://github.com/MohibShaikh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
plugin.yml@e9bf3cfd75bbad5e644718b4fa75fe161a064c07 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_hwcontract-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytest_hwcontract-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b26c599588e1319e592a40e1d9971275e655fc846f90fb12abc8aa40c6e6f2b
|
|
| MD5 |
331fb7d82c6495c2a11e5ec0f1fdd14e
|
|
| BLAKE2b-256 |
0644bbce6f3f6f0551ed4c93ae71d08dac6acebfb3e3fae84190025167b8a6b1
|
Provenance
The following attestation bundles were made for pytest_hwcontract-0.1.1-py3-none-any.whl:
Publisher:
plugin.yml on MohibShaikh/hwcontract
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_hwcontract-0.1.1-py3-none-any.whl -
Subject digest:
6b26c599588e1319e592a40e1d9971275e655fc846f90fb12abc8aa40c6e6f2b - Sigstore transparency entry: 2581982881
- Sigstore integration time:
-
Permalink:
MohibShaikh/hwcontract@e9bf3cfd75bbad5e644718b4fa75fe161a064c07 -
Branch / Tag:
refs/tags/pytest-v0.1.1 - Owner: https://github.com/MohibShaikh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
plugin.yml@e9bf3cfd75bbad5e644718b4fa75fe161a064c07 -
Trigger Event:
push
-
Statement type: