mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 18:34:42 +00:00
tests: Fix exception when cleaning up skipped test
If test_cat and test_xxd cannot create the required file, the test will be skipped, but this would result in an exception being raised in the finally block because the file didn't exist to be cleaned up. This caused the test to be marked as failed instead of skipped. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
22cdb3f0f1
commit
8900ba1ad7
2 changed files with 4 additions and 2 deletions
|
@ -32,4 +32,5 @@ def cat_data(u_boot_config):
|
|||
pytest.skip('Setup failed')
|
||||
finally:
|
||||
shutil.rmtree(mnt_point)
|
||||
os.remove(image_path)
|
||||
if os.path.exists(image_path):
|
||||
os.remove(image_path)
|
||||
|
|
|
@ -32,4 +32,5 @@ def xxd_data(u_boot_config):
|
|||
pytest.skip('Setup failed')
|
||||
finally:
|
||||
shutil.rmtree(mnt_point)
|
||||
os.remove(image_path)
|
||||
if os.path.exists(image_path):
|
||||
os.remove(image_path)
|
||||
|
|
Loading…
Add table
Reference in a new issue