-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Allow schema = None
. Deprecate exclude_from_schema
#5422
Merged
carltongibson
merged 11 commits into
encode:master
from
carltongibson:deprecate-exclude_from_schema
Sep 20, 2017
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8e3844c
Add tests for schema exclusions
carltongibson 6b8bbe8
Move exclusion check to should_include_endpoint
carltongibson f346118
Update docs
carltongibson 9d84e0c
Switch to using `schema = None`
carltongibson 1c2c4f4
Test PendingDeprecationWarnings
carltongibson a966b84
Add note to release notes.
carltongibson d4a4905
s/deprecated/pending deprecation/
carltongibson 6c377a3
Add PR link to release notes
carltongibson f349d35
Correct typo in test class name
carltongibson 0cd24b4
Test 'exclude_from_schema' deprecation warning message (#1)
853dd23
Correct deprecation warning message
carltongibson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
@rpkilby I'm getting console noise in the test run from this. (Well from the call site but...)
Can you advise on the best way to keep that quiet? Ta!
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.
Not sure we need to test this. Don't believe that we've done so when deprecating other bits of API.
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.
django-rest-framework/rest_framework/filters.py
Lines 48 to 52 in efff9ff
and
django-rest-framework/tests/test_filters.py
Lines 172 to 185 in efff9ff
It's something @rpkilby always puts in. I thought, Why not? 🙂
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.
It looks likepytest.warns
isn't recommended for deprecation warnings, as it doesn't capture output.ach... I completely misread the docs. Either way, the below section sufficiently explains how to test deprecation warnings.
https://docs.pytest.org/en/latest/warnings.html#ensuring-function-triggers
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.
@rpkilby OK. Thanks. I read that too but was still getting the noise...
pytest.warns(PendingDeprecationWarning)
because (for me)pytest.deprecated_call()
failed withDID NOT WARN
. No ideas why that wasn't working.(There is plenty of noise from py.test in travis but I assume that'll disappear with time.)
Lets call this done. Thanks for the input!
@tomchristie I think we're good to go.
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.
No noise when running the tests on my machine, so that would make sense.