ward.models

Plugin API

This section contains items from this module that are intended for use by plugin authors or those contributing to Ward itself. If you’re just using Ward to write your tests, this section isn’t relevant.

class ward.models.CollectionMetadata(marker: Optional[ward.models.Marker] = None, description: Optional[str] = None, tags: Optional[List[str]] = None, is_fixture: bool = False, scope: ward.models.Scope = <Scope.Test: 'test'>, bound_args: Optional[inspect.BoundArguments] = None, path: Optional[pathlib.Path] = None)

Attached to tests and fixtures during the collection phase for later use.

class ward.models.ExitCode(value)

Enumeration of the possible exit codes that Ward can exit with.

class ward.models.Scope(value)

The scope of a fixture defines how long it will be cached for.

Test

A test-scoped fixture will be called each time a dependent test runs.

Module

A module-scoped fixture will be called at most once per test module.

Global

A global-scoped fixture will be called at most once per invocation of ward.

class ward.models.SkipMarker(name: str = 'SKIP', reason: Optional[str] = None, when: Union[bool, Callable] = True)

Marker that gets attached to a test (via CollectionMetadata) to indicate it should be skipped.

class ward.models.XfailMarker(name: str = 'XFAIL', reason: Optional[str] = None, when: Union[bool, Callable] = True)

Marker that gets attached to a test (via CollectionMetadata) to indicate that we expect it to fail.