Merge pull request #7226 from nicoddemus/remove-function-args
This commit is contained in:
commit
5a6296a2d7
|
@ -0,0 +1 @@
|
||||||
|
Removed the unused ``args`` parameter from ``pytest.Function.__init__``.
|
|
@ -1389,7 +1389,6 @@ class Function(PyobjMixin, nodes.Item):
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
parent,
|
parent,
|
||||||
args=None,
|
|
||||||
config=None,
|
config=None,
|
||||||
callspec: Optional[CallSpec2] = None,
|
callspec: Optional[CallSpec2] = None,
|
||||||
callobj=NOTSET,
|
callobj=NOTSET,
|
||||||
|
@ -1402,7 +1401,6 @@ class Function(PyobjMixin, nodes.Item):
|
||||||
param name: the full function name, including any decorations like those
|
param name: the full function name, including any decorations like those
|
||||||
added by parametrization (``my_func[my_param]``).
|
added by parametrization (``my_func[my_param]``).
|
||||||
param parent: the parent Node.
|
param parent: the parent Node.
|
||||||
param args: (unused)
|
|
||||||
param config: the pytest Config object
|
param config: the pytest Config object
|
||||||
param callspec: if given, this is function has been parametrized and the callspec contains
|
param callspec: if given, this is function has been parametrized and the callspec contains
|
||||||
meta information about the parametrization.
|
meta information about the parametrization.
|
||||||
|
@ -1418,7 +1416,7 @@ class Function(PyobjMixin, nodes.Item):
|
||||||
(``my_func[my_param]``).
|
(``my_func[my_param]``).
|
||||||
"""
|
"""
|
||||||
super().__init__(name, parent, config=config, session=session)
|
super().__init__(name, parent, config=config, session=session)
|
||||||
self._args = args
|
|
||||||
if callobj is not NOTSET:
|
if callobj is not NOTSET:
|
||||||
self.obj = callobj
|
self.obj = callobj
|
||||||
|
|
||||||
|
|
|
@ -294,9 +294,11 @@ class TestFunction:
|
||||||
def func2():
|
def func2():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
f1 = self.make_function(testdir, name="name", args=(1,), callobj=func1)
|
f1 = self.make_function(testdir, name="name", callobj=func1)
|
||||||
assert f1 == f1
|
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
|
assert f1 != f2
|
||||||
|
|
||||||
def test_repr_produces_actual_test_id(self, testdir):
|
def test_repr_produces_actual_test_id(self, testdir):
|
||||||
|
|
Loading…
Reference in New Issue