Skip to content
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

support for pyproject.toml #839

Open
1Mark opened this issue Oct 27, 2024 · 6 comments
Open

support for pyproject.toml #839

1Mark opened this issue Oct 27, 2024 · 6 comments

Comments

@1Mark
Copy link

1Mark commented Oct 27, 2024

Hello!

pyproject.toml isn't supported and only pytest.ini to enable generate_report_on_test and I have an existing project that uses pyproject.toml with [tool.pytest.ini_options] since you can't use both at the same time, what would you recommend?

@RonnyPfannschmidt
Copy link
Member

The ini option key in pyproject is equivalent to using pytest.ini

@1Mark
Copy link
Author

1Mark commented Oct 28, 2024

The ini option key in pyproject is equivalent to using pytest.ini

That's what I thought but it didn't work.

@RonnyPfannschmidt
Copy link
Member

@1Mark
Copy link
Author

1Mark commented Oct 28, 2024

[tool.pytest.ini_options]
addopts="--html=report.html --self-contained-html"

I managed to get it working via the above.

However, the below does not work

[tool.pytest.ini_options]
generate_report_on_test = "True" 

@tthornton3-chwy
Copy link

tthornton3-chwy commented Jan 6, 2025

@1Mark Here's some context for ya: https://realpython.com/python-toml/#strings-numbers-and-booleans

Take notice of the difference between between TOML and Python's boolean data type, specifically around capitalization :)
Long story short, try

[tool.pytest.ini_options]
generate_report_on_test = true

If that works feel free to close the issue (it should, I tested it!) :)

@1Mark
Copy link
Author

1Mark commented Jan 6, 2025

@1Mark Here's some context for ya: https://realpython.com/python-toml/#strings-numbers-and-booleans

Take notice of the difference between between TOML and Python's boolean data type, specifically around capitalization :)
Long story short, try

[tool.pytest.ini_options]
generate_report_on_test = true

If that works feel free to close the issue (it should, I tested it!) :)

Thanks for looking into this. Will try and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants