Skip to content

Commit 1a6e782

Browse files
add mocked integrationtest for the deprecationwarning of makeitem
1 parent 766de67 commit 1a6e782

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import pytest
2+
3+
from _pytest.python import PyCollector
4+
5+
6+
class PyCollectorMock(PyCollector):
7+
"""evil hack"""
8+
9+
def __init__(self):
10+
self.called = False
11+
12+
def _makeitem(self, *k,):
13+
"""hack to disable the actual behaviour"""
14+
self.called = True
15+
16+
17+
def test_pycollector_makeitem_is_deprecated():
18+
19+
collector = PyCollectorMock()
20+
with pytest.deprecated_call():
21+
collector.makeitem('foo', 'bar')
22+
assert collector.called

0 commit comments

Comments
 (0)