toffee-test
toffee-test is a pytest plugin that provides testing support for the toffee framework. It includes several features to assist users in writing test cases for toffee:
- Identifies test functions as toffee test case objects, making them recognizable and executable by the toffee framework
- Offers resource management for test cases, such as DUT creation and destruction
- Provides test report generation
Installation
-
Properly install toffee and its dependencies.
-
Install toffee-test
To install toffee-test via pip:
pip install toffee-test
Or install the development version:
pip install toffee-test@git+https://github.com/XS-MLVP/toffee-test@master
Or install from source:
git clone https://github.com/XS-MLVP/toffee-test.git
cd toffee-test
pip install .
Usage
Managing Test Case Resources
toffee-test provides the toffee_request fixture for managing test case resources. Use toffee_request to create your own fixture, which can then be used within test cases.
For example, the following code creates a fixture to manage DUT creation and destruction.
import toffee_test
@toffee_test.fixture
def my_fixture(toffee_request: toffee_test.ToffeeRequest):
return toffee_request.create_dut(MyDUT, "clock_pin_name")
Interfaces provided in toffee_request include:
create_dut: Creates a DUTdut_cls: DUT classclock_name: Clock namewaveform_filename: Waveform file namecoverage_filename: Coverage file name
add_cov_groups: Adds coverage groupscov_groups: Coverage groupsperiodic_sample: Periodic sampling option
Marking Test Cases
Use the @toffee_test.testcase decorator to mark test functions, making them recognizable and executable by the toffee framework.
Generating Test Reports
By adding the --toffee-report parameter to the pytest command line, you can generate a toffee test report.
Additionally, the --report-name parameter can specify the report name, and --report-dir can specify the report directory.
Additional Resources
More resources are available at toffee and UnityChip Website.
Metadata
Release files for toffee-test 0.3.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 |
|---|---|---|---|---|
| toffee_test-0.3.1.tar.gz | 30.4 kB | Without provenance | Details for toffee_test-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| toffee_test-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for toffee_test-0.3.1-py3-none-any.whl |
Total release size: 67.8 kB
Release files / toffee_test-0.3.1.tar.gz
| Download URL | toffee_test-0.3.1.tar.gz |
|---|---|
| Size | 30.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be5b3bb588aaaf42907c525342098c05e4842a33b1f8fe42e9cd04c4ea919fb6
|
|
BLAKE2b-256 checksum How to use checksums |
8ebd2a99c680ec4362210349b756403c39d735bebecf456e7cb3b150ab620958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / toffee_test-0.3.1-py3-none-any.whl
| Download URL | toffee_test-0.3.1-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c3fbff80da0c69c9fe9c5ced8f158ffd879fdbfc948479fedc5876a61abf0f8
|
|
BLAKE2b-256 checksum How to use checksums |
10bd753964053d4c696a705525d7a7205c1457802f98371aa7cbabd33f55dc22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Security for toffee-test 0.3.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.
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.