"Das U-Boot" Source Tree

test/py/tests/test_bootstage.py: Combine stash/unstash tests

When running the bootstage tests currently we get a warning like:
tests/test_bootstage.py::test_bootstage_stash
...PytestReturnNotNoneWarning: Expected None, but tests/test_bootstage.py::test_bootstage_stash returned (37748736, 4096), which will be an error in a future version of pytest. Did you mean to use `assert` in stead of `return`?

This is because the unstash test will run the stash test and fetch the
addr / size from that. Rework the test to be stash and unstash and then
run the unstash command at the end of the current stash test.

Acked-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

Tom Rini 8a5ef6ef ab507411

+2 -7
+2 -7
test/py/tests/test_bootstage.py
··· 33 33 @pytest.mark.buildconfigspec('bootstage') 34 34 @pytest.mark.buildconfigspec('cmd_bootstage') 35 35 @pytest.mark.buildconfigspec('bootstage_stash') 36 - def test_bootstage_stash(u_boot_console): 36 + def test_bootstage_stash_and_unstash(u_boot_console): 37 37 f = u_boot_console.config.env.get('env__bootstage_cmd_file', None) 38 38 if not f: 39 39 pytest.skip('No bootstage environment file is defined') ··· 55 55 # Check expected string in last column of output 56 56 output_last_col = ''.join([i.split()[-1] for i in output.split('\n')]) 57 57 assert expected_text in output_last_col 58 - return addr, size 59 58 60 - @pytest.mark.buildconfigspec('bootstage') 61 - @pytest.mark.buildconfigspec('cmd_bootstage') 62 - @pytest.mark.buildconfigspec('bootstage_stash') 63 - def test_bootstage_unstash(u_boot_console): 64 - addr, size = test_bootstage_stash(u_boot_console) 59 + # Check that unstash works as expected 65 60 u_boot_console.run_command('bootstage unstash %x %x' % (addr, size)) 66 61 output = u_boot_console.run_command('echo $?') 67 62 assert output.endswith('0')