diff options
Diffstat (limited to 'test/py/tests')
-rw-r--r-- | test/py/tests/test_env.py | 8 | ||||
-rw-r--r-- | test/py/tests/test_sandbox_exit.py | 2 | ||||
-rw-r--r-- | test/py/tests/test_sleep.py | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py index a3e8dd3..557c3af 100644 --- a/test/py/tests/test_env.py +++ b/test/py/tests/test_env.py @@ -77,11 +77,15 @@ class StateTestEnv(object): return var n += 1 -@pytest.fixture(scope='module') +ste = None +@pytest.fixture(scope='function') def state_test_env(u_boot_console): '''pytest fixture to provide a StateTestEnv object to tests.''' - return StateTestEnv(u_boot_console) + global ste + if not ste: + ste = StateTestEnv(u_boot_console) + return ste def unset_var(state_test_env, var): '''Unset an environment variable. diff --git a/test/py/tests/test_sandbox_exit.py b/test/py/tests/test_sandbox_exit.py index 2aa8eb4..1ec3607 100644 --- a/test/py/tests/test_sandbox_exit.py +++ b/test/py/tests/test_sandbox_exit.py @@ -13,7 +13,6 @@ def test_reset(u_boot_console): u_boot_console.run_command('reset', wait_for_prompt=False) assert(u_boot_console.validate_exited()) - u_boot_console.ensure_spawned() @pytest.mark.boardspec('sandbox') def test_ctrl_c(u_boot_console): @@ -21,4 +20,3 @@ def test_ctrl_c(u_boot_console): u_boot_console.kill(signal.SIGINT) assert(u_boot_console.validate_exited()) - u_boot_console.ensure_spawned() diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py index 64f1ddf..437b6bb 100644 --- a/test/py/tests/test_sleep.py +++ b/test/py/tests/test_sleep.py @@ -9,10 +9,6 @@ def test_sleep(u_boot_console): '''Test the sleep command, and validate that it sleeps for approximately the correct amount of time.''' - # Do this before we time anything, to make sure U-Boot is already running. - # Otherwise, the system boot time is included in the time measurement. - u_boot_console.ensure_spawned() - # 3s isn't too long, but is enough to cross a few second boundaries. sleep_time = 3 tstart = time.time() |