Skip to content

Conversation

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 10, 2024

Today pyproject.toml is the standard for declaring a Python project root, so seems reasonable to consider it for the ini configuration (and specially rootdir) in case we do not find other suitable candidates.

Related to #11311

…e found Today `pyproject.toml` is the standard for declaring a Python project root, so seems reasonable to consider it for the ini configuration (and specially `rootdir`) in case we do not find other suitable candidates. Related to pytest-dev#11311
@nicoddemus nicoddemus marked this pull request as ready for review February 10, 2024 22:23
Comment on lines +180 to +181
Finally, a ``pyproject.toml`` file will be considered the ``configfile`` if no other match was found, in this case
even if it does not contain a ``[tool.pytest.ini_options]`` table (this was added in ``8.1``).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Finally, a ``pyproject.toml`` file will be considered the ``configfile`` if no other match was found, in this case
even if it does not contain a ``[tool.pytest.ini_options]`` table (this was added in ``8.1``).
Finally, a ``pyproject.toml`` file will be considered the ``configfile`` if no other match was found,
even if it does not contain a ``[tool.pytest.ini_options]`` table (this was added in ``8.1``). It will thus define the root dir.

It was unclear for me at first what the purpose of a pyproject.toml without any pytest related config inside was.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Used a slightly different approach, moving this to its own line as it is independent from pyproject.toml itself.

@nicoddemus nicoddemus merged commit acafd00 into pytest-dev:main Feb 14, 2024
@nicoddemus nicoddemus deleted the pyproject-toml-root branch February 14, 2024 19:08
flying-sheep pushed a commit to flying-sheep/pytest that referenced this pull request Apr 9, 2024
…e found (pytest-dev#11962) Today `pyproject.toml` is the standard for declaring a Python project root, so seems reasonable to consider it for the ini configuration (and specially `rootdir`) in case we do not find other suitable candidates. Related to pytest-dev#11311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants