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

Unable to override report:skip_covered #16

Closed
amotl opened this issue Jan 7, 2021 · 7 comments
Closed

Unable to override report:skip_covered #16

amotl opened this issue Jan 7, 2021 · 7 comments

Comments

@amotl
Copy link

amotl commented Jan 7, 2021

Dear Anthony,

thanks a stack for conceiving and maintaining this excellent package.

Through wireviz/wireviz-web@042f04d0, we just added it to wireviz-web and it works like a breeze. As we are using Poetry for package metadata, we store everything relevant within a pyproject.toml file. Now, we found that within this section

[tool.coverage.report]
fail_under = 90
skip_covered = false

overriding fail_under works, but overriding skip_covered apparently does not.

Maybe you can do anything about it?

With kind regards,
Andreas.

@asottile
Copy link
Owner

asottile commented Jan 7, 2021

for booleans in coverage there isn't a way to know the difference between "the default is present as false" or "the user set the value to false"

could you elaborate on why you want skip_covered = false? I understand it's desirable when making html / xml reports so I added an explicit --no-skip-covered option to coverage to facilitate that. At the current time there's no way to configure that setting separately for different tasks

you'll want to consult / follow these (which will provide a potentially better solution):

@amotl
Copy link
Author

amotl commented Jan 7, 2021

Hi Anthony,

thanks for the quick reply. I understand the rationale much better now why it is not possible to override this flag, thanks.

I understand it's desirable when making html / xml reports so I added an explicit --no-skip-covered option to coverage to facilitate that.

I see, that will help. Thanks!

Just for the sake of completeness: Am I right to assume this option is only available for HTML/XML reports? I just tried to apply it to regular terminal output out of curiosity and it does not seem to be available there.

$ pytest --cov --no-skip-covered tests -vvv
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --no-skip-covered
  inifile: None
$ pytest --cov --cov-report=term:no-skip-covered tests -vvv
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: argument --cov-report: output specifier not supported for: "term:no-skip-covered" (choose from "['annotate', 'html', 'xml']")

With kind regards,
Andreas.

@asottile
Copy link
Owner

asottile commented Jan 7, 2021

--no-skip-covered is an option to coverage itself, I'm not sure what pytest-cov is doing there (I don't use it myself as I find it unnecessary) but if it's not passing along the option correctly that's probably their bug

@amotl
Copy link
Author

amotl commented Jan 7, 2021

I've just tried to give this a spin and it works great. Thank you so much for your help.

coverage run --source=wireviz_web $(which pytest) tests -vvvv && coverage report --no-skip-covered

P.S.: However, I've discovered a different problem with that but will open another issue in order not to pollute this one.

@amotl amotl closed this as completed Jan 7, 2021
@asottile
Copy link
Owner

asottile commented Jan 7, 2021

instead of $(which pytest) you can probably use -mpytest by the way

@amotl
Copy link
Author

amotl commented Jan 7, 2021

Instead of $(which pytest) you can probably use -mpytest by the way.

That also works. Much better. Great!

coverage run --source=wireviz_web --module pytest tests -vvvv && coverage report --no-skip-covered

@amotl
Copy link
Author

amotl commented Jan 7, 2021

P.S.: However, I've discovered a different problem with that but will open another issue in order not to pollute this one.

That was completely our fault, sorry - nothing to report here. I wish you happy new year and want to thank you again for your excellent support.

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