'pytest pyproject.toml configuration to ignore a specific path

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"   


Solution 1:[1]

Use the following in pyproject.toml

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eptarch