Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2878 from RonnyPfannschmidt/collector-makeitem-de…
…precate deprecate the public internal PyCollector.makeitem method
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
|
||
from _pytest.python import PyCollector | ||
|
||
|
||
class PyCollectorMock(PyCollector): | ||
"""evil hack""" | ||
|
||
def __init__(self): | ||
self.called = False | ||
|
||
def _makeitem(self, *k): | ||
"""hack to disable the actual behaviour""" | ||
self.called = True | ||
|
||
|
||
def test_pycollector_makeitem_is_deprecated(): | ||
|
||
collector = PyCollectorMock() | ||
with pytest.deprecated_call(): | ||
collector.makeitem('foo', 'bar') | ||
assert collector.called |