Files
sunnypilot/openpilot/tools/sim/tests/test_metadrive_bridge.py
T
github-actions[bot] 08e4e3b2d2 sunnypilot v2026.003.000 release
date: 2026-09-02T13:32:21
master commit: 47db84ebfb
2026-09-02 13:32:22 +00:00

23 lines
791 B
Python

import warnings
import unittest
import importlib
# Since metadrive depends on pkg_resources, and pkg_resources is deprecated as an API
warnings.filterwarnings("ignore", category=DeprecationWarning)
try:
MetaDriveBridge = importlib.import_module("openpilot.tools.sim.bridge.metadrive.metadrive_bridge").MetaDriveBridge
except ModuleNotFoundError:
MetaDriveBridge = None
from openpilot.tools.sim.tests.test_sim_bridge import TestSimBridgeBase
@unittest.skipIf(MetaDriveBridge is None, "metadrive is not installed")
class TestMetaDriveBridge(TestSimBridgeBase):
def setup_method(self):
super().openpilot_setup_method()
self.test_duration = 30
def create_bridge(self):
assert MetaDriveBridge is not None
return MetaDriveBridge(False, False, self.test_duration, True)