Skip to content

Commit 93e55ad

Browse files
committed
Remove unused attribute and parameter in CallSpec2
1 parent 2925f30 commit 93e55ad

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

changelog/3598.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Internal refactoring: removed unused ``CallSpec2tox ._globalid_args`` attribute and ``metafunc`` parameter from ``CallSpec2.copy()``.

src/_pytest/python.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,13 +735,12 @@ def __init__(self, metafunc):
735735
self._idlist = []
736736
self.params = {}
737737
self._globalid = NOTSET
738-
self._globalid_args = set()
739738
self._globalparam = NOTSET
740739
self._arg2scopenum = {} # used for sorting parametrized resources
741740
self.marks = []
742741
self.indices = {}
743742

744-
def copy(self, metafunc):
743+
def copy(self):
745744
cs = CallSpec2(self.metafunc)
746745
cs.funcargs.update(self.funcargs)
747746
cs.params.update(self.params)
@@ -750,7 +749,6 @@ def copy(self, metafunc):
750749
cs._arg2scopenum.update(self._arg2scopenum)
751750
cs._idlist = list(self._idlist)
752751
cs._globalid = self._globalid
753-
cs._globalid_args = self._globalid_args
754752
cs._globalparam = self._globalparam
755753
return cs
756754

@@ -933,7 +931,7 @@ def parametrize(self, argnames, argvalues, indirect=False, ids=None, scope=None)
933931
param.values, argnames
934932
)
935933
)
936-
newcallspec = callspec.copy(self)
934+
newcallspec = callspec.copy()
937935
newcallspec.setmulti2(
938936
valtypes,
939937
argnames,

0 commit comments

Comments
 (0)