mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 21:43:59 +08:00
test_car_model: remove duplicate argument (#29309)
* only need to pass test_route
* unused
old-commit-hash: 6106876da7
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import sys
|
||||
from typing import List, Tuple
|
||||
from typing import List
|
||||
import unittest
|
||||
|
||||
from selfdrive.car.tests.routes import CarTestRoute
|
||||
@@ -9,11 +9,11 @@ from selfdrive.car.tests.test_models import TestCarModel
|
||||
from tools.lib.route import SegmentName
|
||||
|
||||
|
||||
def create_test_models_suite(routes: List[Tuple[str, CarTestRoute]], ci=False) -> unittest.TestSuite:
|
||||
def create_test_models_suite(routes: List[CarTestRoute], ci=False) -> unittest.TestSuite:
|
||||
test_suite = unittest.TestSuite()
|
||||
for car_model, test_route in routes:
|
||||
for test_route in routes:
|
||||
# create new test case and discover tests
|
||||
test_case_args = {"car_model": car_model, "test_route": test_route, "ci": ci}
|
||||
test_case_args = {"car_model": test_route.car_model, "test_route": test_route, "ci": ci}
|
||||
CarModelTestCase = type("CarModelTestCase", (TestCarModel,), test_case_args)
|
||||
test_suite.addTest(unittest.TestLoader().loadTestsFromTestCase(CarModelTestCase))
|
||||
return test_suite
|
||||
@@ -33,6 +33,6 @@ if __name__ == "__main__":
|
||||
route_or_segment_name = SegmentName(args.route_or_segment_name.strip(), allow_route_name=True)
|
||||
segment_num = route_or_segment_name.segment_num if route_or_segment_name.segment_num != -1 else None
|
||||
test_route = CarTestRoute(route_or_segment_name.route_name.canonical_name, args.car, segment=segment_num)
|
||||
test_suite = create_test_models_suite([(args.car, test_route)], ci=args.ci)
|
||||
test_suite = create_test_models_suite([test_route], ci=args.ci)
|
||||
|
||||
unittest.TextTestRunner().run(test_suite)
|
||||
|
||||
Reference in New Issue
Block a user