unittest usage with micropython
Posted: Sat Sep 01, 2018 2:36 am
I have some experience with using standard unittest library with Python3.6 on PC. But it seems like uPy version of this library is a bit different. (https://github.com/micropython/micropyt ... r/unittest)
If I place my test_project.py in the same directory with my main project, I can run my tests in rshell using
repl ~ unittest.main('test_project') ~
But when I place my test_project.py in a directory named tests which contains __init__.py and test_project.py unittest can't discover my tests when I try command:
repl ~ unittest.main('tests.test_project') ~
I'd like to place all my tests in dedicated directory because otherwise there are too much clutter in /flash/. How can I achieve that? Thanks.
If I place my test_project.py in the same directory with my main project, I can run my tests in rshell using
repl ~ unittest.main('test_project') ~
But when I place my test_project.py in a directory named tests which contains __init__.py and test_project.py unittest can't discover my tests when I try command:
repl ~ unittest.main('tests.test_project') ~
I'd like to place all my tests in dedicated directory because otherwise there are too much clutter in /flash/. How can I achieve that? Thanks.