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

TST Add coverage report to pytest runs #67

Merged
merged 1 commit into from
Aug 1, 2022
Merged

TST Add coverage report to pytest runs #67

merged 1 commit into from
Aug 1, 2022

Conversation

BenjaminBossan
Copy link
Collaborator

Running pytest now gives an output like this:

---------- coverage: platform linux, python 3.10.5-final-0 -----------
Name                              Stmts   Miss  Cover   Missing
---------------------------------------------------------------
skops/__init__.py                     8      1    88%   31
skops/card/__init__.py                2      0   100%
skops/card/_model_card.py            52      0   100%
skops/hub_utils/__init__.py           2      0   100%
skops/hub_utils/_hf_hub.py           98     21    79%   92-94, 125-127, 310, 356-365, 463-473
skops/hub_utils/tests/common.py       1      0   100%
skops/utils/fixes.py                 18      4    78%   13, 22, 56-57
---------------------------------------------------------------
TOTAL                               181     26    86%

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

Nice!

@adrinjalali
Copy link
Member

I'm personally happy w/o them when I run pytest, since certain lines are only run in certain environments, but we can try and remove later if we don't like it.

@adrinjalali adrinjalali changed the title Add coverage report to pytest runs TST Add coverage report to pytest runs Aug 1, 2022
@adrinjalali adrinjalali merged commit 808ae66 into skops-dev:main Aug 1, 2022
@BenjaminBossan
Copy link
Collaborator Author

I'm personally happy w/o them when I run pytest, since certain lines are only run in certain environments, but we can try and remove later if we don't like it.

Yes, true. I think it can sometimes be helpful as a developer to see what lines are and aren't covered, e.g. when adding a new module. If you don't need it, just ignore the output, but if you need it, getting the invocation right is a bit tricky so I wanted to configure it for convenience.

@adrinjalali
Copy link
Member

I perefer make commands for things which tricky to run, but sometimes needed.

@BenjaminBossan
Copy link
Collaborator Author

make has its place but it can also be kinda rigid sometimes. It really depends on the the situation.

Anyway, since you merged it, I assume it was good enough ;)

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

Successfully merging this pull request may close these issues.

2 participants