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

pytest>6.2.0 emits warnings for unraisable exceptions and unhandled thread exceptions under Python 3.8+ #355

Closed
1 of 4 tasks
webknjaz opened this issue Jan 4, 2021 · 2 comments
Assignees
Labels
bug Something is broken

Comments

@webknjaz
Copy link
Member

webknjaz commented Jan 4, 2021

❓ I'm submitting a ...

  • 🐞 tests bug report
  • 🐞 bug report
  • 🐣 feature request
  • ❓ question about the decisions made in the repository

🐞 Describe the bug. What is the current behavior?

pytest 6.2.0 introduced unraisableexception and threadexception modules that are enabled by default. They exploit sys.unraisablehook and threading.excepthook that were introduced in Python 3.8.
This makes pytest emit warnings for unclosed resources and unhandled exceptions that happen in threads when run under Python 3.8.

Our pytest.ini turns those exceptions into errors with filterwarnings = error which results in a failed test run outcome under the conditions described above.

The short-term solution is to patch the filterwarnings setting but in the long-term we need to investigate how to prevent those permanently.

❓ What is the motivation / use case for changing the behavior?

Green tests.

πŸ’‘ To Reproduce

Run tox under Python 3.8+ on master.

πŸ’‘ Expected behavior

No errors in CI.

πŸ“‹ Details

https://docs.pytest.org/en/stable/usage.html#unraisable

πŸ“‹ Environment

  • Cheroot version: master
  • CherryPy version: N/A
  • Python version: 3.8+
  • OS: N/A
  • Browser: N/A

πŸ“‹ Additional context

pytest-dev/pytest#5299

@bnavigator
Copy link

bnavigator commented Jan 22, 2022

This is no longer an issue in 8.6.0

#370, #371, 0b16749

@webknjaz webknjaz removed the triage label Jan 23, 2022
@webknjaz
Copy link
Member Author

Thanks for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants