File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -840,6 +840,13 @@ Function
840
840
:members:
841
841
:show-inheritance:
842
842
843
+ FunctionDefinition
844
+ ~~~~~~~~~~~~~~~~~~
845
+
846
+ .. autoclass :: _pytest.python.FunctionDefinition()
847
+ :members:
848
+ :show-inheritance:
849
+
843
850
Item
844
851
~~~~
845
852
Original file line number Diff line number Diff line change @@ -960,6 +960,7 @@ def __init__(
960
960
cls = None ,
961
961
module = None ,
962
962
) -> None :
963
+ #: Access to the underlying :class:`_pytest.python.FunctionDefinition`.
963
964
self .definition = definition
964
965
965
966
#: Access to the :class:`_pytest.config.Config` object for the test session.
@@ -1677,10 +1678,12 @@ def repr_failure( # type: ignore[override]
1677
1678
1678
1679
1679
1680
class FunctionDefinition (Function ):
1680
- """Internal hack until we get actual definition nodes instead of the
1681
- crappy metafunc hack."""
1681
+ """
1682
+ This class is a step gap solution until we evolve to have actual function definition nodes
1683
+ and manage to get rid of ``metafunc``.
1684
+ """
1682
1685
1683
1686
def runtest (self ) -> None :
1684
- raise RuntimeError ("function definitions are not supposed to be used " )
1687
+ raise RuntimeError ("function definitions are not supposed to be run as tests " )
1685
1688
1686
1689
setup = runtest
You can’t perform that action at this time.
0 commit comments