From a1a60ed32040c9e51e06935600ca29126a06d7cd Mon Sep 17 00:00:00 2001 From: grdddj Date: Wed, 28 Jun 2023 13:09:03 +0200 Subject: [PATCH] feat(tests): skip SD card tests for TR - allowing to run unittests for TR [no changelog] --- core/tests/test_trezor.io.fatfs.py | 7 +++++-- core/tests/test_trezor.io.sdcard.py | 6 +++--- core/tests/test_trezor.sdcard.py | 9 +++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/tests/test_trezor.io.fatfs.py b/core/tests/test_trezor.io.fatfs.py index 1aa470cdc..359228c5f 100644 --- a/core/tests/test_trezor.io.fatfs.py +++ b/core/tests/test_trezor.io.fatfs.py @@ -1,7 +1,9 @@ from common import * -from trezorio import fatfs, sdcard +from trezor import utils +if utils.USE_SD_CARD: + from trezorio import fatfs, sdcard class TestTrezorIoFatfs(unittest.TestCase): @@ -226,4 +228,5 @@ class TestTrezorIoFatfsAndSdcard(unittest.TestCase): if __name__ == "__main__": - unittest.main() + if utils.USE_SD_CARD: + unittest.main() diff --git a/core/tests/test_trezor.io.sdcard.py b/core/tests/test_trezor.io.sdcard.py index 229389e8d..497bee290 100644 --- a/core/tests/test_trezor.io.sdcard.py +++ b/core/tests/test_trezor.io.sdcard.py @@ -1,7 +1,6 @@ from common import * -from trezor import io - +from trezor import io, utils class TestTrezorIoSdcard(unittest.TestCase): @@ -44,4 +43,5 @@ class TestTrezorIoSdcard(unittest.TestCase): if __name__ == "__main__": - unittest.main() + if utils.USE_SD_CARD: + unittest.main() diff --git a/core/tests/test_trezor.sdcard.py b/core/tests/test_trezor.sdcard.py index 3cfcfa8c0..851c4ae97 100644 --- a/core/tests/test_trezor.sdcard.py +++ b/core/tests/test_trezor.sdcard.py @@ -1,9 +1,9 @@ from common import * -from trezor import io, sdcard +from trezor import io, sdcard, utils - -fatfs = io.fatfs +if utils.USE_SD_CARD: + fatfs = io.fatfs class TestTrezorSdcard(unittest.TestCase): @@ -89,4 +89,5 @@ class TestTrezorSdcard(unittest.TestCase): if __name__ == "__main__": - unittest.main() + if utils.USE_SD_CARD: + unittest.main()