Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/TestGlobalCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class TestGlobalCache:
sm_Guard = threading.Lock()
sm_Dict: typing.Dict[str, any] = dict
sm_Dict: typing.Dict[str, any] = dict()

# --------------------------------------------------------------------
def __init__(self):
Expand All @@ -24,7 +24,8 @@ def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any:
assert resourceFactory is not None
assert isinstance(globalResourceID, str)
assert __class__.sm_Guard is not None
assert isinstance(__class__.sm_Dict, dict)
assert __class__.sm_Dict is not None
assert type(__class__.sm_Dict) == dict # noqa: E721

with __class__.sm_Guard:
if globalResourceID in __class__.sm_Dict.keys():
Expand All @@ -40,7 +41,8 @@ def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any:
# --------------------------------------------------------------------
def ReleaseAllResources():
assert __class__.sm_Guard is not None
assert isinstance(__class__.sm_Dict, dict)
assert __class__.sm_Dict is not None
assert type(__class__.sm_Dict) == dict # noqa: E721

with __class__.sm_Guard:
emptyDict: typing.Dict[str, any] = dict()
Expand Down