Skip to content

Configuration

src

include

A list of files and directories to check. Including a file or directory will make it so that it (and its contents) are tested.

  • tests matches a directory named tests
  • tests/test.py matches a file named test.py in the tests directory

Default value: null

Type: list[str]

Example usage (pyproject.toml):

TOML
1
2
[tool.karva.src]
include = ["tests"]

respect-ignore-files

Whether to automatically exclude files that are ignored by .ignore, .gitignore, .git/info/exclude, and global gitignore files. Enabled by default.

Default value: true

Type: bool

Example usage (pyproject.toml):

TOML
1
2
[tool.karva.src]
respect-ignore-files = false

terminal

output-format

The format to use for printing diagnostic messages.

Defaults to full.

Default value: full

Type: full | concise

Example usage (pyproject.toml):

TOML
1
2
[tool.karva.terminal]
output-format = "concise"

show-python-output

Whether to show the python output.

This is the output the print goes to etc.

Default value: true

Type: true | false

Example usage (pyproject.toml):

TOML
1
2
[tool.karva.terminal]
show-python-output = false

test

fail-fast

Whether to fail fast when a test fails.

Defaults to false.

Default value: false

Type: true | false

Example usage (pyproject.toml):

TOML
1
2
[tool.karva.test]
fail-fast = true

test-function-prefix

The prefix to use for test functions.

Defaults to test.

Default value: test

Type: string

Example usage (pyproject.toml):

TOML
1
2
[tool.karva.test]
test-function-prefix = "test"