Introduce LaxJsonDict type and use it in tests where JsonDict is relied upon being lax. - #20105
Open
reivilibre wants to merge 3 commits into
Open
Introduce LaxJsonDict type and use it in tests where JsonDict is relied upon being lax.#20105reivilibre wants to merge 3 commits into
LaxJsonDict type and use it in tests where JsonDict is relied upon being lax.#20105reivilibre wants to merge 3 commits into
Conversation
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.
Part of: #20103
This pull request is intended for commit-by-commit review.
This PR does not change any semantics, it just makes the reliance of
JsonDict's laxity (?) explicit in relevant places of the test suite, in preparation for makingJsonDictstrict in the future.It's a few-line tiny change in the first commit, plus a lot of repetitively simple boring/easily-verifiable mechanical changes in the second commit.
Introduce LaxJsonDict
Use LaxJsonDict in some tests
NOTE: This is a search and replace of
JsonDict→LaxJsonDictin thetestsmodule only, using an LLM-scripted 'trial and error' process to allegedly only make the necessary replacements.I can't guarantee that every replacement is necessary, however via the manual testing steps below, it is easy to verify that this is sufficient.
In simpler times, I wouldn't have been against replacing all
JsonDictoccurrences in tests withLaxJsonDictas we don't frankly need to be strict in tests (and the goal here is not to make writing tests any more painful).As a result, it's my opinion that even if the LLM-scripted trial and error process did make unnecessary replacements, it's not a big deal here.
Manual Testing
To show that this set of replacements is sufficient to make the tests able to cope with a strict-ification of
JsonDict,simulate converting all remaining instances of
JsonDicttoStrictJsonDictwithin the tests module and runmypy: