New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for .pytest.ini as an alternative to pytest.ini #9988
Conversation
Added config search option of ".pytest.ini" in addition to "pytest.ini"
Hidden version of pytest.ini documented.
Added hidden configuration file info to changelog.
Added myself to AUTHORS file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but we need an explicit test that loads from a .pytest.ini
file to avoid regressions.
For an example see test_pyproject_toml
in test_config.py
, I think we can create a new test which follows the same approach taken there.
Took the liberty of adding the test myself (we just needed to add a new parameter to a parametrized test actually). Thanks @grintor! |
) | ||
def test_ini_names(self, pytester: Pytester, name, section) -> None: | ||
pytester.path.joinpath(name).write_text( | ||
textwrap.dedent( | ||
""" | ||
[{section}] | ||
minversion = 1.0 | ||
minversion = 3.36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used a more unusual version number than 1.0 just to be more clear that we are getting the actual value (1.0 seems a bit like it could be a default value).
Adds support for
.pytest.ini
as an alternative topytest.ini
. Closes #9987