pytest pyproject.toml configuration to ignore a specific path

Viewed 1273

Are there any ways to set a path to ignore in pyproject.toml like

#pyproject.toml
[tool.pytest.ini_options]
ignore = ["path/to/test"]

instead of using addopts:

#pyproject.toml
[tool.pytest.ini_options]
addopts = "--ignore=path/to/test"   
1 Answers

Use the following in pyproject.toml

norecursedirs = [
    "path/to/test/*",
]
Related