Skip to content

Commit f74182c

Browse files
python Function instance: remove duplicate code
1 parent c7393f7 commit f74182c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/_pytest/python.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1596,11 +1596,8 @@ def instance(self):
15961596
try:
15971597
return self._instance
15981598
except AttributeError:
1599-
if isinstance(self.parent, Class):
1600-
# Each Function gets a fresh class instance.
1601-
self._instance = self._getinstance()
1602-
else:
1603-
self._instance = None
1599+
# Each Function gets a fresh class instance.
1600+
self._instance = self._getinstance()
16041601
return self._instance
16051602

16061603
def _getinstance(self):

0 commit comments

Comments
 (0)