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

ref: add fixture to prevent leaked signal handlers #88740

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

asottile-sentry
Copy link
Member

No description provided.

Copy link

codecov bot commented Apr 3, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tests/conftest.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #88740   +/-   ##
=======================================
  Coverage   87.71%   87.72%           
=======================================
  Files       10076    10076           
  Lines      569898   569913   +15     
  Branches    22387    22387           
=======================================
+ Hits       499913   499935   +22     
+ Misses      69586    69579    -7     
  Partials      399      399           

@asottile-sentry asottile-sentry force-pushed the asottile-leaked-signal-handlers branch from 991fbf8 to e7de77d Compare April 7, 2025 14:25
@asottile-sentry asottile-sentry marked this pull request as ready for review April 7, 2025 14:25
Comment on lines +157 to +159
got is not None
and not isinstance(got, int)
and got is not signal.default_int_handler
Copy link
Contributor

Choose a reason for hiding this comment

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

How come this special casing?
Surely if these differ before vs after there's something unhygeinic going on, and the difference between SIG_IGN SIG_DFL and None seems significant, to me.

At least comment and explain?

@asottile-sentry asottile-sentry merged commit ea61ad2 into master Apr 8, 2025
46 checks passed
@asottile-sentry asottile-sentry deleted the asottile-leaked-signal-handlers branch April 8, 2025 18:43
@pytest.fixture(autouse=True)
def check_leaked_signals() -> Generator[None]:
before = frozenset(_leaked_signals())
yield
Copy link
Member

Choose a reason for hiding this comment

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

Neat, learned about pytest yield fixtures today :)

Christinarlong pushed a commit that referenced this pull request Apr 10, 2025
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.

3 participants