Skip to content

Commit

Permalink
prep sst_unittest for refactor
Browse files Browse the repository at this point in the history
We're pulling initializeTestModule_SingleInstance() up to SSTTestCase
so we don't need to repeat it for every subclass.
  • Loading branch information
jmlapre committed Jul 31, 2024
1 parent 95aed59 commit 83e4f9d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sst/core/testingframework/sst_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ class SSTTestCase(unittest.TestCase):
This class is derived from Python's unittest.TestCase which provides an
basic resource for how to develop tests for this frameworks.
"""
module_init = 0
module_sema = threading.Semaphore()

@classmethod
def initializeTestModule_SingleInstance(cls):
with cls.module_sema:
if cls.module_init != 1:
# Put your single instance Init Code Here
cls.module_init = 1

def __init__(self, methodName):
# NOTE: __init__ is called at startup for all tests before any
Expand Down

0 comments on commit 83e4f9d

Please sign in to comment.