extensible.extensible#

Functions

always(method)

By default, post methods do not run if an error occurred in the center stage unless they are decorated with this decorator.

randname()

Classes

Extensible([extensions])

FixturesDict(*args, **kwargs)

PostHookContextManager(extensible, method)

All post- hooks are executed as the __exit__() method of this context manager within an ExitStack.

PreHookContextManager(extensible, method)

All pre- hooks are executed as the __enter__() method of this context manager within an ExitStack.

Exceptions

FixtureError

exception extensible.extensible.FixtureError#

Bases: KeyError

class extensible.extensible.PreHookContextManager(extensible: Extensible, method: Callable)#

Bases: object

All pre- hooks are executed as the __enter__() method of this context manager within an ExitStack.

extensible.extensible.always(method)#

By default, post methods do not run if an error occurred in the center stage unless they are decorated with this decorator. When decorated, they run whether an error occurred or not.

Post methods decorated with always() should have default values for all their fixture parameters, as exceptions might result in missing fixtures.

class extensible.extensible.PostHookContextManager(extensible: Extensible, method: Callable)#

Bases: AbstractContextManager

All post- hooks are executed as the __exit__() method of this context manager within an ExitStack. The post- hook calls are wrapped in a stage that injects 'exc_type', 'exc_value', and 'traceback' hooks that follow the same protocol as standard python __exit__ methods. In particular, they will all be None if no exception occurred during the center stage and non-None otherwise.