Skip to content

Test

invoke_tasklib.test

Test and benchmark tasks.

invoke_tasklib.test.all

all(c: Context, cov: bool = False) -> None

Run all tests (unit, integration, and functional).

Parameters:

Name Type Description Default
c Context

The invoke context.

required
cov bool

If True, generate coverage reports in HTML, XML, and terminal formats. Default is False.

False

invoke_tasklib.test.benchmark

benchmark(c: Context) -> None

Run performance benchmarks.

invoke_tasklib.test.coverage_report

coverage_report(
    c: Context, open_browser: bool = False
) -> None

Generate an HTML coverage report from the last recorded coverage data and print the terminal summary.

Parameters:

Name Type Description Default
c Context

The invoke context.

required
open_browser bool

If True, open the generated HTML report in the default web browser. Default is False.

False

invoke_tasklib.test.doctest

doctest(c: Context) -> None

Run doctests on both source code and markdown files.

invoke_tasklib.test.doctest_markdown

doctest_markdown(c: Context) -> None

Run doctests on Python code examples embedded in markdown files.

invoke_tasklib.test.doctest_src

doctest_src(c: Context) -> None

Run doctests on source code.

invoke_tasklib.test.functional

functional(c: Context, cov: bool = False) -> None

Run functional tests.

Parameters:

Name Type Description Default
c Context

The invoke context.

required
cov bool

If True, generate coverage reports (appended). Default is False.

False

invoke_tasklib.test.integration

integration(c: Context, cov: bool = False) -> None

Run integration tests.

Parameters:

Name Type Description Default
c Context

The invoke context.

required
cov bool

If True, generate coverage reports (appended). Default is False.

False

invoke_tasklib.test.unit

unit(c: Context, cov: bool = False) -> None

Run unit tests.

Parameters:

Name Type Description Default
c Context

The invoke context.

required
cov bool

If True, generate coverage reports. Default is False.

False