Skip to content

Commit 5a6296a

Browse files
authored
Merge pull request #7226 from nicoddemus/remove-function-args
2 parents 85a06cf + ad31694 commit 5a6296a

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
@@ -1389,7 +1389,6 @@ def __init__(
13891389
self,
13901390
name,
13911391
parent,
1392-
args=None,
13931392
config=None,
13941393
callspec: Optional[CallSpec2] = None,
13951394
callobj=NOTSET,
@@ -1402,7 +1401,6 @@ def __init__(
14021401
param name: the full function name, including any decorations like those
14031402
added by parametrization (``my_func[my_param]``).
14041403
param parent: the parent Node.
1405-
param args: (unused)
14061404
param config: the pytest Config object
14071405
param callspec: if given, this is function has been parametrized and the callspec contains
14081406
meta information about the parametrization.
@@ -1418,7 +1416,7 @@ def __init__(
14181416
(``my_func[my_param]``).
14191417
"""
14201418
super().__init__(name, parent, config=config, session=session)
1421-
self._args = args
1419+
14221420
if callobj is not NOTSET:
14231421
self.obj = callobj
14241422

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)