Closed williamfzc closed 4 years ago
Because the unittest
base class was designed for unit tests, whereas Mobly tests are e2e tests that are more complex.
E.g. features like on_fail
, multi-error reporting mechanism, and separate assertion module do not exist in unittest
.
Thanks I see.
oh, another question:
Mobly was designed as a complete test framework not a package. So using without TestClass is not encouraged (I guess because all the examples working inside TestClass), and some important methods are also built-in members of TestClass, like register_controller
.
Mobly offered lots of powerful API. Is there an official way to use them without TestClass?
Mobly is designed to be modular, so the controller modules can be directly imported and used as libraries without Mobly's base class. But if your purpose is to write test cases, I'd still suggest using Mobly's base class over unittest
. Because unittest
simply couldn't handle the complexity inherent to e2e tests.
Hi
https://github.com/google/mobly/blob/6f867938373e096ac5207b04b42699fb0935a519/mobly/base_test.py#L52
Just a little curious about why
mobly
implemented a new independent test class module? Using built-inunittest
instead looks more extendable