Fix not: {}
schemas when given falsy instances.
#181
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.
These were improperly considering objects like None to be valid under that schema.
The fix here simply adds {} as another special cased schema, since presumably the
is True
block is meant as an optimization.Note that there are of course many other things you can give to
not
which disallow any possible instance, likenot: {"title": "foo"}
but the fallback block should presumably catch them.The block that was deleted here never looks correct to me (so I've simply deleted it). Running the updated test suite would seem to confirm, as this change takes the suite from:
to
i.e. a strict increase in compliance.
--
In order to put in this fix I updated your copy of the test suite, which seemed quite out of date.
You can also normally see those results on Bowtie's report for the implementation though actually this bug was discovered (and additional tests added to the test suite) because Bowtie "smoke tests" implementations when it builds them with some simple schemas to ensure basic correctness -- and these schemas are the ones it uses, which actually were incorrectly failing!, hence the PR.
Doing the test suite upgrade leaves lots of failures for other behavior -- I'm not sure what you typically do for that, whether you mark them as
xfail
until you fix them or whatever.