A py.test
plugin for grunnur
#
This package contains a collection of helpers useful for testing grunnur
-based libraries and applications.
See the Grunnur docs for more details about the main package.
Indices and tables#
Public API#
Py.Test hooks#
These are invoked automatically if you use pytest_grunnur
as a py.test
plugin.
- pytest_grunnur.plugin.pytest_addoption(parser: Parser) None [source]#
Adds the following command-line options:
--api
: select a specific API to test (out of returned bygrunnur.all_api_ids()
).--platform-include-mask
: run tests only on platforms whose names matches the mask.--platform-exclude-mask
: exclude platforms whose names matches the mask from the tests.--device-include-mask
: run tests only on devices whose names matches the mask.--device-exclude-mask
: exclude devices whose names matches the mask from the tests.--include-duplicate-devices
: if there are devices with the same name in the platform, run tests on all of them.--include-pure-parallel-devices
: include pure parallel devices in the tests (that is, those not supporting synchronization within a block/work group).
Fixtures#
- pytest_grunnur.plugin.api(request: FixtureRequest) Iterator[API] [source]#
Yields the elements of the return value of
get_apis()
.
- pytest_grunnur.plugin.platform(request: FixtureRequest) Iterator[Platform] [source]#
Yields the elements of the return value of
get_platforms()
.
- pytest_grunnur.plugin.device(request: FixtureRequest) Iterator[Device] [source]#
Yields the elements of the return value of
get_devices()
.
- pytest_grunnur.plugin.context(device: Device) Iterator[Context] [source]#
A single-device context for each device yielded by
device()
.
- pytest_grunnur.plugin.some_device(request: FixtureRequest) Iterator[Device] [source]#
Yields one element of the return value of
get_devices()
.
- pytest_grunnur.plugin.some_context(some_device: Device) Iterator[Context] [source]#
A single-device context initialized with the return value of
some_device()
.
Utility functions#
- pytest_grunnur.get_apis(config: Config) List[API] [source]#
Returns the list of APIs filtered by the test configuration.
- pytest_grunnur.get_platforms(config: Config) List[Platform] [source]#
Returns the list of platforms filtered by the test configuration (concatenated for all filtered APIs).
Version history#
0.2.2 (Unreleased)#
Under construction.
0.2.1 (5 Feb 2023)#
Fixed#
Switched back to static versioning.
0.2.0 (4 Feb 2023)#
All the fixtures are now explicitly defined.
0.1.0 (29 Jan 2023)#
Initial version