Fix type validators to work with future versions of type hints#146
Merged
callumforrester merged 2 commits intomainfrom Apr 24, 2023
Merged
Fix type validators to work with future versions of type hints#146callumforrester merged 2 commits intomainfrom
callumforrester merged 2 commits intomainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #146 +/- ##
==========================================
+ Coverage 74.52% 74.59% +0.07%
==========================================
Files 37 37
Lines 1048 1051 +3
==========================================
+ Hits 781 784 +3
Misses 267 267
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
DiamondJoseph
approved these changes
Apr 24, 2023
keithralphs
pushed a commit
that referenced
this pull request
Apr 28, 2023
* Add future annotations to type validator test and fix issues to do with lazy evaluation * Handle case of type annotation not being present
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several tests broke when using
Because in the future type annotations will be more lazily. We must use a specific function,
typing.get_type_hintsto properly evaluate them.This is annoying as we still need to use
signature().parametersto get the default values, but I could not find a better way.This PR adds the future import to the tests and invokes the requires function.