-
Notifications
You must be signed in to change notification settings - Fork 12
gh-866: exclude imports from coverage report #867
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
Conversation
connoraird
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The coverage seems to have decreased. Does this not remove the lines from the percentage?
|
@paddyroddy I'm not sure I follow. So the import lines are still counted in the total number of lines to be covered. Does that mean this ignore is purely for the highlighting in the coveralls UI? |
Pretty much. The lines aren't counted in those to be covered. It's the same reason we're doing it for the others |
|
See #279 |
This statement is incorrect |
|
@connoraird failing with this. Think we shouldn't do
|
Weird, I originally had just |
We're doing |
|
Actually the issue is that it's not in a type checking block. You aren't really meant to import from test files |
|
Related pytest-dev/pytest#349 |
Yeah I know you're not supposed to but I didn't know how else to use import conftest
...
@pytest.mark.stable
@pytest.mark.parametrize(
"xp",
[
xp
for name, xp in conftest.xp_available_backends.items()
if name != "jax.numpy"
],
)
def test_displacement(
benchmark: BenchmarkFixture,
urng: UnifiedGenerator,
xp: ModuleType, # noqa: ARG001
) -> None:
"""Benchmark for glass.displacement with all backends, but jax."""
_benchmark_displacement(benchmark, urng) |
|
@paddyroddy Unless I make a fixture which excludes jax from xp? |
Let's do that. I'll revert the changes in this PR and wait until we've got that in. |
|
Broken due to changes in #864. Will merge as the fixes are unrelated. |



Description
Following the work in #865, this PR further excludes imports. Currently,
glass/cosmology.pyreports 0% coverage, which isn't true. This is a bit overkill but should make the percentage more clear.Have also adjusted the
@overloaddecorator to avoid the case of, i.e.@overloaded,Closes: #866
Checks