Skip to content

Configuring Checker

The checker plugin comes with a custom marker called check_config that you can use for configuring the checker on a per-test basis.

To use it, just import the object, and decorate your tests with it.

from zeloscloud.pytest.checker import check_config


@check_config(config_option=config_value)
def test_foo(check):

Note

config_option=config_value is not a real config option/value. It's just an example. Please see below for a look at real options and what they do!

Configuration Options

Below is a table of the available configuration options for check_config:

Option Description Default
fail_fast Determines whether the test should halt on the first failure. True

Using fail_fast

By default, fail_fast is set to True. This means a test will halt of the first failure.

def test_default_behaviour(check):
    check.that(1, "==", 1)  # This will pass
    check.that(1, "==", 2)  # This will fail, and the test stops here
    # Any code here will not execute
To evaluate all checks in a test regardless of failures, set fail_fast to False:

@check_config(fail_fast=False)
def test_with_fail_fast_disabled(check):
    check.that(1, "==", 1)  # This will pass
    check.that(1, "==", 2)  # This will fail, but the test continues
    # Additional checks or code can go here