-
Notifications
You must be signed in to change notification settings - Fork 59
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
Handle None types #742
Handle None types #742
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #742 +/- ##
==========================================
+ Coverage 84.27% 91.71% +7.43%
==========================================
Files 26 55 +29
Lines 5127 15681 +10554
Branches 1447 2792 +1345
==========================================
+ Hits 4321 14382 +10061
- Misses 800 1291 +491
- Partials 6 8 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
84d04ed
to
83e1aae
Compare
…pe-checking/coercing
83e1aae
to
a7fbf26
Compare
I did a superficial read of the diff and what I checked so far looked sensible 👍 |
@pytest.mark.skipif(sys.version_info < (3, 10), reason="No UnionType < Py3.10") | ||
def test_type_check_fail2a(): | ||
with pytest.raises(TypeError, match="to any of the union types"): | ||
TypeParser(Path | File)(lz(int)) |
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.
Isn't it possible to run this test with a from __future__ import annotations
for Python < 3.10?
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.
from __future__ import annotations
just leaves all annotations as strings I believe. Probably need to have a separate test module to handle that case, but since it doesn't look like that will be the way that types are handled going forward I have tended to avoid it
Types of changes
Summary
int | None
instead oftyping.Optional[int]
Checklist
added by @ghisvail
Closes #744