Skip to content

Commit

Permalink
Merge pull request #3598 from nicoddemus/small-callspec2-cleanup
Browse files Browse the repository at this point in the history
Remove unused attribute and parameter in CallSpec2
  • Loading branch information
RonnyPfannschmidt authored Jun 20, 2018
2 parents 5b26178 + 93e55ad commit e86fe38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/3598.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Internal refactoring: removed unused ``CallSpec2tox ._globalid_args`` attribute and ``metafunc`` parameter from ``CallSpec2.copy()``.
6 changes: 2 additions & 4 deletions src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,12 @@ def __init__(self, metafunc):
self._idlist = []
self.params = {}
self._globalid = NOTSET
self._globalid_args = set()
self._globalparam = NOTSET
self._arg2scopenum = {} # used for sorting parametrized resources
self.marks = []
self.indices = {}

def copy(self, metafunc):
def copy(self):
cs = CallSpec2(self.metafunc)
cs.funcargs.update(self.funcargs)
cs.params.update(self.params)
Expand All @@ -750,7 +749,6 @@ def copy(self, metafunc):
cs._arg2scopenum.update(self._arg2scopenum)
cs._idlist = list(self._idlist)
cs._globalid = self._globalid
cs._globalid_args = self._globalid_args
cs._globalparam = self._globalparam
return cs

Expand Down Expand Up @@ -933,7 +931,7 @@ def parametrize(self, argnames, argvalues, indirect=False, ids=None, scope=None)
param.values, argnames
)
)
newcallspec = callspec.copy(self)
newcallspec = callspec.copy()
newcallspec.setmulti2(
valtypes,
argnames,
Expand Down

0 comments on commit e86fe38

Please sign in to comment.