Support VirtualEnv and parameterized tests
This commit introduces the use of VirtualEnv to manage test
dependencies. Specifically:
1. `PythonVirtualenvPreparer` is invoked before running tests
to set up the isolated Python environment.
2. The test is declared as a `MoblyBinaryHostTest` to enable
VirtualEnv compatibility, as `PythonBinaryHostTest` lacks
this support.
3. The Mobly test runner is invoked manually to accommodate
multiple test classes, which is not supported by
`mobly.test_runner.main()`.
4. Test classes are refactored to inherit from
`mobly.BaseTestClass` for compatibility with the Mobly
test runner.
This change is a prerequisite for subsequent commits that will
install libraries via `pip install`, facilitating isolated
dependency management for improved test reliability and
maintainability.
Also, this commit uses parameterized annotation from absl
to rewrite several tests as paremeterized tests.
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: Iffa2f8fa81c3913f3e08cca01b2c009ca959db73
6 files changed