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
fix type errors, add type tests #118
Conversation
for more information, see https://pre-commit.ci
…ns from future in _suppress Also fix ruff warning from sections in pyproject
Pull Request Test Coverage Report for Build 8744686812Details
💛 - Coveralls |
One more thing: could you add a changelog note too? I'll merge when that's done. |
I don't really understand #112, but more or less copied over the commit message to the changelog. |
It looks like the 3.12 failure is unrelated to this PR |
Seems like this started within the last 24 hours. Perhaps caused by a Python update? |
Yeah it went from 3.12.2 (https://github.com/agronholm/exceptiongroup/actions/runs/8706318205/job/23878615916#step:3:12) to 3.12.3 (https://github.com/agronholm/exceptiongroup/actions/runs/8736236104/job/23970716558#step:3:12) |
Thanks! |
tests/type_test.py
as type test, which quickly alerted me to two additional errors I also fixed:BaseExceptionGroup
andExceptionGroup
was also lackingtype[...]
, but instead of getting an error at creation it instead returningExceptionGroup[Unknown]
.suppress
was typed as expecting instances ofBaseException
, but README was passing a class. I went with assuming the README was correct and it should only accept exception classes, but maybe it should accept either?cast
tosuppress.__exit__
so that file now type checks, though the code isn't type checked in CI so /shrug.The type test could be much more thorough, and given that I almost instantly found an unrelated error with
suppress
I suspect there could be more issues hidden. You should definitely add repro's of any other issues you have, and I might check them out and see if they have easy fixes.