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

Problematic -> NoReturn exclusion #152

Closed
webknjaz opened this issue Sep 2, 2024 · 9 comments
Closed

Problematic -> NoReturn exclusion #152

webknjaz opened this issue Sep 2, 2024 · 9 comments

Comments

@webknjaz
Copy link

webknjaz commented Sep 2, 2024

The plugin has -> ['"]?NoReturn['"]?: in excludes. However, when I attempted integrating covdefaults, a co-maintainer pointed out that it's useful to measure coverage in functions that always raise exceptions (aio-libs/yarl#1084 (comment)). One example is aiohttp's web response exceptions raised from HTTP handlers like https://github.com/aio-libs/aiohttp/blob/731ba4d/tests/test_client_functional.py#L1178-L1179.

@asottile could you document a justification for not measuring such cases? Any chance to have a way to remove this specific exclusion?

@asottile
Copy link
Owner

asottile commented Sep 2, 2024

most NoReturn functions are unmeasurable (such as ones calling os.execvp)

@asottile asottile closed this as completed Sep 2, 2024
@webknjaz
Copy link
Author

webknjaz commented Sep 2, 2024

@asottile I think that all of NoReturn functions I've ever seen are measurable, though. How to enable measuring them with covdefaults installed?

@asottile
Copy link
Owner

asottile commented Sep 2, 2024

don't opt in to covdefaults if you don't want what it does? idk

@webknjaz
Copy link
Author

webknjaz commented Sep 2, 2024

I want all it does, except for this one thing. Can't there be an option to modify the defaults similar to subtract_omit? subtract_exclude_lines?

@asottile
Copy link
Owner

asottile commented Sep 2, 2024

idk if it's possible you'd have to research and implement it since generally I'm moving more to an open source stance of: I'm not going to build something I won't use

@webknjaz
Copy link
Author

webknjaz commented Sep 2, 2024

Just to clarify: are you saying the project doesn't want PRs either?

@asottile
Copy link
Owner

asottile commented Sep 2, 2024

you'd have to research and implement it

that sounds like a PR to me no?

@webknjaz
Copy link
Author

webknjaz commented Sep 2, 2024

It sounded like you didn't want to maintain any contributed code anymore. Accepting a PR includes reviewing, releasing, and maintaining new code, after all. So I had to ask. Maintaining a fork is also something I was considering if the divergence is too big.

Other than that, copying-and-pasting https://github.com/asottile/covdefaults/blob/77f9ff9/covdefaults.py#L121-L122 is something I could delegate to a mentee 🤷‍♂️

Still, I need to check for one surprise incompatibility that popped up with PyPy to decide if it'll be possible to use the plugin even with that patch.

@asottile
Copy link
Owner

asottile commented Sep 2, 2024

no what I meant is I'm not building random features for free any more

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