diff options
author | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2016-11-05 17:45:32 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-11-21 14:07:27 -0500 |
commit | d8c1e0331ac31aefe32c9182a44b612617008288 (patch) | |
tree | e05161f3a93629a30bd8b8cf53385d2b47407c79 /test/py | |
parent | 2d0c2c47aa2d81c9a5033ffa1e28cd34b1b24e9d (diff) | |
download | u-boot-d8c1e0331ac31aefe32c9182a44b612617008288.tar.gz |
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: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'test/py')
-rw-r--r-- | test/py/conftest.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/py/conftest.py b/test/py/conftest.py index 1f15e3e33d..65e1d75626 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -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. |