提交 d8c1e033 编写于 作者: S Stefan Brüns 提交者: Tom Rini

test/py: expose config and log as session scoped fixture

If a test uses a fixture which is expensive to setup, the fixture can
possibly created with session or module scope. As u_boot_console has
function scope, it can not be used in this case.
Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: NStephen Warren <swarren@wwwdotorg.org>
上级 2d0c2c47
......@@ -298,6 +298,32 @@ def pytest_generate_tests(metafunc):
continue
generate_config(metafunc, fn)
@pytest.fixture(scope='session')
def u_boot_log(request):
"""Generate the value of a test's log fixture.
Args:
request: The pytest request.
Returns:
The fixture value.
"""
return console.log
@pytest.fixture(scope='session')
def u_boot_config(request):
"""Generate the value of a test's u_boot_config fixture.
Args:
request: The pytest request.
Returns:
The fixture value.
"""
return console.config
@pytest.fixture(scope='function')
def u_boot_console(request):
"""Generate the value of a test's u_boot_console fixture.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册