Skip to content

Commit d520f81

Browse files
author
Sylvain MARIE
committed
Increased tolerance to other plugins: Now when other plugins try to manipulate the fixture closure, warning messages are emitted but no error is raised. Fixed #55
1 parent 4a9c0b4 commit d520f81

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pytest_cases/plugin.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,20 @@ def __getitem__(self, item):
126126
def __setitem__(self, key, value):
127127
# This is called in Pytest 4+. TODO how should we behave ?
128128
warn("WARNING the new order is not taken into account !!")
129-
pass
129+
130+
def append(self, item):
131+
warn("WARNING some code tries to add an item to the fixture tree, this will be IGNORED !! Item: %s" % item)
132+
133+
def insert(self, index, object):
134+
warn("WARNING some code tries to insert an item in the fixture tree, this will be IGNORED !! "
135+
"Item: %s, Index: %s" % (index, object))
136+
137+
def pop(self, index):
138+
warn("WARNING some code tries to pop an item from the fixture tree, this will be IGNORED !! Index: %s" % index)
139+
140+
def extend(self, iterable):
141+
if len(iterable) > 0:
142+
warn("WARNING some code tries to extend the fixture tree, this will be IGNORED !! Iterable: %s" % iterable)
130143

131144
def index(self, *args):
132145
return self.to_list().index(*args)

0 commit comments

Comments
 (0)