Skip to content

Commit

Permalink
Remove unused Function.__init__ 'args' parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed May 18, 2020
1 parent 8b9b81c commit 3e73ca9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,6 @@ def __init__(
self,
name,
parent,
args=None,
config=None,
callspec: Optional[CallSpec2] = None,
callobj=NOTSET,
Expand All @@ -1399,7 +1398,6 @@ def __init__(
param name: the full function name, including any decorations like those
added by parametrization (``my_func[my_param]``).
param parent: the parent Node.
param args: (unused)
param config: the pytest Config object
param callspec: if given, this is function has been parametrized and the callspec contains
meta information about the parametrization.
Expand All @@ -1415,7 +1413,7 @@ def __init__(
(``my_func[my_param]``).
"""
super().__init__(name, parent, config=config, session=session)
self._args = args

if callobj is not NOTSET:
self.obj = callobj

Expand Down
6 changes: 4 additions & 2 deletions testing/python/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,11 @@ def func1():
def func2():
pass

f1 = self.make_function(testdir, name="name", args=(1,), callobj=func1)
f1 = self.make_function(testdir, name="name", callobj=func1)
assert f1 == f1
f2 = self.make_function(testdir, name="name", callobj=func2)
f2 = self.make_function(
testdir, name="name", callobj=func2, originalname="foobar"
)
assert f1 != f2

def test_repr_produces_actual_test_id(self, testdir):
Expand Down

0 comments on commit 3e73ca9

Please sign in to comment.