android_packages_modules_Co.../staticlibs/tests/unit/host/python
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Junyu Lai 3085caaac0 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
2024-07-03 02:02:40 +00:00
..
adb_utils_test.py Support VirtualEnv and parameterized tests 2024-07-03 02:02:40 +00:00
apf_utils_test.py Support VirtualEnv and parameterized tests 2024-07-03 02:02:40 +00:00
assert_utils_test.py Support VirtualEnv and parameterized tests 2024-07-03 02:02:40 +00:00
run_tests.py Support VirtualEnv and parameterized tests 2024-07-03 02:02:40 +00:00
test_config.xml Support VirtualEnv and parameterized tests 2024-07-03 02:02:40 +00:00