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

Empty lines count towards coverage #24171

Closed
bpasero opened this issue Sep 24, 2024 · 4 comments
Closed

Empty lines count towards coverage #24171

bpasero opened this issue Sep 24, 2024 · 4 comments
Assignees
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@bpasero
Copy link
Member

bpasero commented Sep 24, 2024

Testing #24156

I had this test:

import pytest
import time


@pytest.mark.parametrize("num", range(1, 10))
# this is unclear





def test_num(num):
    time.sleep(0.3)
    assert True
    # nd even more



And the coverage without empty lines is at 85.71% but now at 66.67%:

Image

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 24, 2024
@eleanorjboyd
Copy link
Member

gave this a try and am not seeing this- what version of python are you on? Are any of those empty lines actually containing spaces?Image

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Sep 24, 2024
@bpasero
Copy link
Member Author

bpasero commented Sep 25, 2024

@eleanorjboyd I am using 3.12.5

Image

Find the file with new lines attached:

test_wait_parameterized.py.zip

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Sep 25, 2024
@eleanorjboyd
Copy link
Member

huh even with the right python version I am not seeing the comments impact code coverage. Did you have any pytest arguments during this run? I think I can just close this since the decision on the code coverage percentage / numbers are dictated by coverage.py and communicated the extension so in the end we don't have control over the numbers as long as they are getting there correctly. You could always try running it in the terminal python -m pytest --cov=. to see if you get a similar result because our goal is to always mirror the tool behavior.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Sep 25, 2024
Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants