ITADN

`yield` fixture decorated with `@keyword` does not get executed

#362OpenDetachHead 创建于 2025-11-07
D
DetachHeadcommented
```py from __future__ import annotations from pytest import fixture from robot.api import logger from pytest_robotframework import keyword @fixture @keyword def foo(): logger.info("setup") # doesn't get run yield "asdf" logger.info("teardown") # doesn't get run def test_foo(foo: str): logger.info(foo) # prints <generator object foo at 0x73543ca43280> instead of "asdf" ``` it's not clear what decorating such a fixture as a `@keyword` is even supposed to do. so it should probably just be an error (ideally both a type error and a runtime error)
0 条评论