Skip to content

Commit ad31694

Browse files
committed
Remove unused Function.__init__ 'args' parameter
1 parent 8b9b81c commit ad31694

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

changelog/7226.breaking.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removed the unused ``args`` parameter from ``pytest.Function.__init__``.

src/_pytest/python.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,6 @@ def __init__(
13861386
self,
13871387
name,
13881388
parent,
1389-
args=None,
13901389
config=None,
13911390
callspec: Optional[CallSpec2] = None,
13921391
callobj=NOTSET,
@@ -1399,7 +1398,6 @@ def __init__(
13991398
param name: the full function name, including any decorations like those
14001399
added by parametrization (``my_func[my_param]``).
14011400
param parent: the parent Node.
1402-
param args: (unused)
14031401
param config: the pytest Config object
14041402
param callspec: if given, this is function has been parametrized and the callspec contains
14051403
meta information about the parametrization.
@@ -1415,7 +1413,7 @@ def __init__(
14151413
(``my_func[my_param]``).
14161414
"""
14171415
super().__init__(name, parent, config=config, session=session)
1418-
self._args = args
1416+
14191417
if callobj is not NOTSET:
14201418
self.obj = callobj
14211419

testing/python/collect.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,11 @@ def func1():
294294
def func2():
295295
pass
296296

297-
f1 = self.make_function(testdir, name="name", args=(1,), callobj=func1)
297+
f1 = self.make_function(testdir, name="name", callobj=func1)
298298
assert f1 == f1
299-
f2 = self.make_function(testdir, name="name", callobj=func2)
299+
f2 = self.make_function(
300+
testdir, name="name", callobj=func2, originalname="foobar"
301+
)
300302
assert f1 != f2
301303

302304
def test_repr_produces_actual_test_id(self, testdir):

0 commit comments

Comments
 (0)