-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Actually deprecate long standing features #3978
Merged
RonnyPfannschmidt
merged 8 commits into
pytest-dev:features
from
nicoddemus:warn-yield-and-compat-properties
Sep 15, 2018
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
495a557
Separate deprecations and removals in the CHANGELOG
nicoddemus bf074b3
Show deprecation warnings for compat properties
nicoddemus 482bd5e
Show deprecation warning for cached_setup
nicoddemus b7dd915
Deprecate custom node types during collection by using special names
nicoddemus feb8240
Use self.Function again during collection
nicoddemus 32ee0b9
Move warning messages to _pytest.deprecated
nicoddemus da6830f
Introduce UnformattedWarning to keep warning types and messages in _p…
nicoddemus ae8f369
Move UnformattedWarning to _pytest.warning_types
nicoddemus 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
The following accesses have been documented as deprecated for years, but are now actually emitting deprecation warnings. | ||
|
||
* Access of ``Module``, ``Function``, ``Class``, ``Instance``, ``File`` and ``Item`` through ``Node`` instances. Now | ||
users will this warning:: | ||
|
||
usage of Function.Module is deprecated, please use pytest.Module instead | ||
|
||
Users should just ``import pytest`` and access those objects using the ``pytest`` module. | ||
|
||
* ``request.cached_setup``, this was the precursor of the setup/teardown mechanism available to fixtures. You can | ||
consult `funcarg comparision section in the docs <https://docs.pytest.org/en/latest/funcarg_compare.html>`_. | ||
|
||
* Using objects named ``"Class"`` as a way to customize the type of nodes that are collected in ``Collector`` | ||
subclasses has been deprecated. Users instead should use ``pytest_collect_make_item`` to customize node types during | ||
collection. | ||
|
||
This issue should affect only advanced plugins who create new collection types, so if you see this warning | ||
message please contact the authors so they can change the code. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -800,7 +800,7 @@ def collect(self): | |
"%r generated tests with non-unique name %r" % (self, name) | ||
) | ||
seen[name] = True | ||
values.append(self.Function(name, self, args=args, callobj=call)) | ||
values.append(Function(name, self, args=args, callobj=call)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a breaking change, not doing it is why i had massive trouble with the warnings |
||
self.warn(deprecated.YIELD_TESTS) | ||
return values | ||
|
||
|
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.
i had massive issue about one part of those warnings being triggered from pytest internals by accident which is why i deffered it on the old warnings system
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.
catch_warnings
to the rescue. 😁It won't show the warnings for this specific access, but I guess that's OK because the whole class will be kicked out anyway. 👍