From 9f086d6d90913818e42206e0e6833d514820093c Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Wed, 8 Jan 2025 15:24:19 -0700 Subject: [PATCH] Allow SkipTestCase in python --- openc3-cosmos-script-runner-api/scripts/running_script.py | 2 ++ openc3/python/openc3/script/suite_runner.py | 2 -- openc3/python/test/models/test_microservice_model.py | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openc3-cosmos-script-runner-api/scripts/running_script.py b/openc3-cosmos-script-runner-api/scripts/running_script.py index ed280d039..8eb3070f2 100644 --- a/openc3-cosmos-script-runner-api/scripts/running_script.py +++ b/openc3-cosmos-script-runner-api/scripts/running_script.py @@ -99,6 +99,7 @@ def _openc3_script_sleep(sleep_time=None): from openc3.io.stderr import Stderr from openc3.top_level import kill_thread from openc3.script.exceptions import StopScript, SkipScript +from openc3.tools.test_runner.test import SkipTestCase from openc3.script.suite import Group from script_instrumentor import ScriptInstrumentor import openc3.utilities.target_file_importer @@ -537,6 +538,7 @@ def exception_instrumentation(self, filename, line_number): if ( exc_type == StopScript or exc_type == SkipScript + or exc_type == SkipTestCase # DEPRECATED but still valid or not self.use_instrumentation ): raise exc_value diff --git a/openc3/python/openc3/script/suite_runner.py b/openc3/python/openc3/script/suite_runner.py index eb647f497..1564f5ec7 100644 --- a/openc3/python/openc3/script/suite_runner.py +++ b/openc3/python/openc3/script/suite_runner.py @@ -20,10 +20,8 @@ from openc3.script.exceptions import StopScript import inspect - class UnassignedSuite(Suite): """Placeholder for all Groups discovered without assigned Suites""" - pass diff --git a/openc3/python/test/models/test_microservice_model.py b/openc3/python/test/models/test_microservice_model.py index e6ee08d76..799dfeff4 100644 --- a/openc3/python/test/models/test_microservice_model.py +++ b/openc3/python/test/models/test_microservice_model.py @@ -16,11 +16,9 @@ import inspect import unittest -import tempfile from unittest.mock import * from test.test_helper import * from openc3.models.microservice_model import MicroserviceModel -from openc3.config.config_parser import ConfigParser class TestMicroserviceModel(unittest.TestCase):