diff options
author | Bruno Oliveira <nicoddemus@gmail.com> | 2020-10-31 10:00:48 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 10:00:48 -0300 |
commit | 2753859ff0b406f97e0f24f558741b47e5e67854 (patch) | |
tree | 279fa7bbfe136b57fe4637f27a6debd3a9c51e10 /src/_pytest | |
parent | a14a229d1bb9a7fe75799caa974b2cfb8f02f8b3 (diff) | |
parent | 569c091769d6739d262ee796e71f5f70dc81bf19 (diff) | |
download | pytest-2753859ff0b406f97e0f24f558741b47e5e67854.tar.gz |
Merge pull request #7979 from nicoddemus/metafunc-ref
Add FunctionDefinition to the reference docs
Diffstat (limited to 'src/_pytest')
-rw-r--r-- | src/_pytest/python.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 35797cc07..9e988032d 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -960,6 +960,7 @@ class Metafunc: cls=None, module=None, ) -> None: + #: Access to the underlying :class:`_pytest.python.FunctionDefinition`. self.definition = definition #: Access to the :class:`_pytest.config.Config` object for the test session. @@ -1677,10 +1678,12 @@ class Function(PyobjMixin, nodes.Item): class FunctionDefinition(Function): - """Internal hack until we get actual definition nodes instead of the - crappy metafunc hack.""" + """ + This class is a step gap solution until we evolve to have actual function definition nodes + and manage to get rid of ``metafunc``. + """ def runtest(self) -> None: - raise RuntimeError("function definitions are not supposed to be used") + raise RuntimeError("function definitions are not supposed to be run as tests") setup = runtest |