cocotb_wrapper.testbench.Testbench.register_test#
- Testbench.register_test(timeout_time=None, timeout_unit='step', expect_fail=False, expect_error=(), skip=False, stage=0)[source]#
Decorate a function to register the function as a test.
- Parameters:
timeout_time (int | None) – The duration before a timeout occurs
timeout_unit (str) – The unit of the timeout time
expect_fail (bool) – Don’t mark the test as failed if the test fails.
expect_error (Exception | tuple[Exception, ...]) – Mark the test as passed only if the given exception is raised
skip (bool) – Skip this test
stage (int) – Order tests logically into stages, where multiple test can share a stage
- Returns:
A decorator function
- Return type:
Callable[[Callable[[HierarchyObject], Awaitable[None]]], Callable[[HierarchyObject], Awaitable[None]]]