【发布时间】:2019-03-08 17:33:22
【问题描述】:
遵循此模式:https://docs.pytest.org/en/latest/xunit_setup.html
我如何使用/注入fixture_foo 到setup_method
class TestClassX:
def setup_method(self, method):
# I need `fixture_foo` here
def teardown_method(self, method):
# N/A
def test_cool(self, fixture_foo):
# Why can `fixture_foo` be injected here and not in `setup_method`?
【问题讨论】: