Files
trezor-firmware/core/tests
tychovrahe eb72fb4241 refactor(core): remove unused functions
[no changelog]
2023-04-19 21:36:51 +02:00
..
2020-02-20 12:51:48 +01:00
2019-12-23 12:01:00 +00:00

Unit tests

Unit tests test some smaller individual parts of code (mainly functions and classes) and are run by micropython directly.

How to run them

Run all tests:

make test

Run a specific test file:

make test TESTOPTS=test_apps.bitcoin.signtx.py

WARNING: unittests cannot run with frozen emulator, use make build_unix to create non-frozen emulator.

Usage

Please use the unittest.TestCase class:

from common import *

class TestSomething(unittest.TestCase):

    test_something(self):
        self.assertTrue(True)

Usage of assert is discouraged because it is not evaluated in production code (when PYOPT=1). Use self.assertXY instead, see unittest.py.