Skip to content

Commit 744bb94

Browse files
Merge pull request #1186 from sstsimulator/devel
Automatically Merged using SST Master Branch Merger
2 parents bdaa8f3 + efc8de4 commit 744bb94

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/sst/core/model/xmlToPython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def printTree(indent: int, node: ET.Element) -> None:
4545

4646
def processString(string: str) -> str:
4747
"""Process a string, replacing variables and env. vars with their values"""
48-
def replaceSSTVar(matchobj: re.Match) -> str:
48+
def replaceSSTVar(matchobj: re.Match[str]) -> str:
4949
varname = matchobj.group(1)
5050
return sstVars[varname]
5151

52-
def replaceEnvVar(matchobj: re.Match) -> str:
52+
def replaceEnvVar(matchobj: re.Match[str]) -> str:
5353
varname = matchobj.group(1)
5454
var = os.getenv(varname)
5555
assert var is not None

src/sst/core/testingframework/sst_test_engine_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ def startup_and_run(sst_core_bin_dir: str, test_mode: int) -> None:
7272
sys.exit(1)
7373

7474
t_e = test_engine.TestEngine(sst_core_bin_dir, test_mode)
75-
t_e.discover_and_run_tests()
75+
sys.exit(t_e.discover_and_run_tests())
7676

7777
except Exception as exc_e:
7878
# NOTE: This is a generic catchall handler for any unhandled exception
7979
_generic_exception_handler(exc_e)
8080

8181
###############
8282

83-
def _generic_exception_handler(exc_e):
83+
def _generic_exception_handler(exc_e: Exception) -> None:
8484

8585
# Dump Exception info to the a log file
8686
log_filename = "./sst_test_frameworks_crashreport.log"
@@ -91,7 +91,7 @@ def _generic_exception_handler(exc_e):
9191
log_handler = RotatingFileHandler(log_filename, mode='a',
9292
maxBytes=10*1024*1024,
9393
backupCount=10,
94-
encoding=None, delay=0)
94+
encoding=None, delay=False)
9595
log_handler.setFormatter(log_formatter)
9696
crashlogger.addHandler(log_handler)
9797
crashlogger.setLevel(logging.DEBUG)

src/sst/core/testingframework/sst_unittest_parameterized.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
# -*- coding: utf-8 -*-
23
##
34
##Unless stated otherwise in the source files, all code is copyright 2010 David

src/sst/core/testingframework/test_engine.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def __init__(self, sst_core_bin_dir: str, test_mode: int) -> None:
139139

140140
####
141141

142-
def discover_and_run_tests(self):
142+
def discover_and_run_tests(self) -> int:
143143
""" Create the output directories, then discover the tests, and then
144144
run them using pythons unittest module
145145
@@ -183,17 +183,17 @@ def discover_and_run_tests(self):
183183
sst_tests_results = test_runner.run(self._sst_full_test_suite)
184184

185185
if not test_runner.did_tests_pass(sst_tests_results):
186-
exit(1)
187-
exit(0)
186+
return 1
187+
return 0
188188

189189
# Handlers of unittest.TestRunner exceptions
190190
except KeyboardInterrupt:
191191
log_fatal("TESTING TERMINATED DUE TO KEYBOARD INTERRUPT...")
192-
exit(2)
192+
return 2
193193

194194
####
195195

196-
def _build_tests_list_helper(self, suite):
196+
def _build_tests_list_helper(self, suite: SSTTestSuite) -> List[Any]:
197197
"""
198198
A helper function to split the tests for the ConcurrentTestSuite into
199199
some number of concurrently executing sub-suites. _build_tests_list_helper

0 commit comments

Comments
 (0)