-
-
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
Remove dead-code related to yield tests #4829
Merged
nicoddemus
merged 3 commits into
pytest-dev:features
from
nicoddemus:yield-tests-dead-code
Mar 13, 2019
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 @@ | ||
Some left-over internal code related to ``yield`` tests has been removed. |
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -156,14 +156,9 @@ def pytest_configure(config): | |||||||||
@hookimpl(trylast=True) | ||||||||||
def pytest_pyfunc_call(pyfuncitem): | ||||||||||
testfunction = pyfuncitem.obj | ||||||||||
if pyfuncitem._isyieldedfunction(): | ||||||||||
testfunction(*pyfuncitem._args) | ||||||||||
else: | ||||||||||
funcargs = pyfuncitem.funcargs | ||||||||||
testargs = {} | ||||||||||
for arg in pyfuncitem._fixtureinfo.argnames: | ||||||||||
testargs[arg] = funcargs[arg] | ||||||||||
testfunction(**testargs) | ||||||||||
funcargs = pyfuncitem.funcargs | ||||||||||
testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} | ||||||||||
testfunction(**testargs) | ||||||||||
return True | ||||||||||
|
||||||||||
|
||||||||||
|
@@ -1405,7 +1400,7 @@ def __init__( | |||||||||
|
||||||||||
if fixtureinfo is None: | ||||||||||
fixtureinfo = self.session._fixturemanager.getfixtureinfo( | ||||||||||
self, self.obj, self.cls, funcargs=not self._isyieldedfunction() | ||||||||||
self, self.obj, self.cls, funcargs=True | ||||||||||
) | ||||||||||
self._fixtureinfo = fixtureinfo | ||||||||||
self.fixturenames = fixtureinfo.names_closure | ||||||||||
|
@@ -1419,16 +1414,6 @@ def __init__( | |||||||||
|
||||||||||
def _initrequest(self): | ||||||||||
self.funcargs = {} | ||||||||||
if self._isyieldedfunction(): | ||||||||||
assert not hasattr( | ||||||||||
self, "callspec" | ||||||||||
), "yielded functions (deprecated) cannot have funcargs" | ||||||||||
else: | ||||||||||
if hasattr(self, "callspec"): | ||||||||||
callspec = self.callspec | ||||||||||
assert not callspec.funcargs | ||||||||||
if hasattr(callspec, "param"): | ||||||||||
self.param = callspec.param | ||||||||||
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 no longer seems to be used anywhere, the Lines 888 to 891 in 91b6f2b
|
||||||||||
self._request = fixtures.FixtureRequest(self) | ||||||||||
|
||||||||||
@property | ||||||||||
|
@@ -1448,9 +1433,6 @@ def _pyfuncitem(self): | |||||||||
"(compatonly) for code expecting pytest-2.2 style request objects" | ||||||||||
return self | ||||||||||
|
||||||||||
def _isyieldedfunction(self): | ||||||||||
return getattr(self, "_args", None) is not None | ||||||||||
|
||||||||||
def runtest(self): | ||||||||||
""" execute the underlying test function. """ | ||||||||||
self.ihook.pytest_pyfunc_call(pyfuncitem=self) | ||||||||||
|
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.
Not covered. Also previously: https://codecov.io/gh/pytest-dev/pytest/src/3fd2f43fb6b7bcd2eb342d0d7056381937d3d8db/src/_pytest/debugging.py