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

Pass coverage related arguments to pytest #1146

Open
m-rph opened this issue Jun 7, 2024 · 3 comments
Open

Pass coverage related arguments to pytest #1146

m-rph opened this issue Jun 7, 2024 · 3 comments

Comments

@m-rph
Copy link

m-rph commented Jun 7, 2024

Hello,

Thank you for the project!

I have a feature request:

I'd like to be able to pass additional coverage related flags when running tests.
In particular, I'd like --cov [package], --cov-report, --cov-fail-under.

Alternatively, I'd like if possible to be able to just pass whatever subsequent arguments and just forward them to pytest.

@m-rph
Copy link
Author

m-rph commented Jun 7, 2024

By the way, I wouldn't mind implementing this if the bandwidth isn't here.

@my1e5
Copy link
Contributor

my1e5 commented Jun 7, 2024

Isn't this already possible? See https://rye.astral.sh/guide/commands/test/ and [EXTRA_ARGS]...

Also you can add extra args in your pyproject.toml file. For example

[tool.pytest.ini_options]
addopts = "--cov=myproject --cov-report html"

@m-rph
Copy link
Author

m-rph commented Jun 8, 2024

Ugh, that's right, I missed the -- part— this is embarrassing... Feel free to close then.

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

2 participants