| 31 | |
| 32 | class TestMetafunc: |
| 33 | def Metafunc(self, func, config=None) -> python.Metafunc: |
| 34 | # The unit tests of this class check if things work correctly |
| 35 | # on the funcarg level, so we don't need a full blown |
| 36 | # initialization. |
| 37 | class FuncFixtureInfoMock: |
| 38 | name2fixturedefs = None |
| 39 | |
| 40 | def __init__(self, names): |
| 41 | self.names_closure = names |
| 42 | |
| 43 | @attr.s |
| 44 | class DefinitionMock(python.FunctionDefinition): |
| 45 | obj = attr.ib() |
| 46 | _nodeid = attr.ib() |
| 47 | |
| 48 | names = getfuncargnames(func) |
| 49 | fixtureinfo: Any = FuncFixtureInfoMock(names) |
| 50 | definition: Any = DefinitionMock._create(func, "mock::nodeid") |
| 51 | return python.Metafunc(definition, fixtureinfo, config, _ispytest=True) |
| 52 | |
| 53 | def test_no_funcargs(self) -> None: |
| 54 | def function(): |