Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit212de33

Browse files
fix: TestGlobalCache is corrected (#3)
* fix: bad TestGlobalCache::sm_Dict* TestGlobalCache is updated (new asserts)* TestGlobalCache is updated (exact debug checks)
1 parentc4e6273 commit212de33

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎tests/TestGlobalCache.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
classTestGlobalCache:
1515
sm_Guard=threading.Lock()
16-
sm_Dict:typing.Dict[str,any]=dict
16+
sm_Dict:typing.Dict[str,any]=dict()
1717

1818
# --------------------------------------------------------------------
1919
def__init__(self):
@@ -24,7 +24,8 @@ def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any:
2424
assertresourceFactoryisnotNone
2525
assertisinstance(globalResourceID,str)
2626
assert__class__.sm_GuardisnotNone
27-
assertisinstance(__class__.sm_Dict,dict)
27+
assert__class__.sm_DictisnotNone
28+
asserttype(__class__.sm_Dict)==dict# noqa: E721
2829

2930
with__class__.sm_Guard:
3031
ifglobalResourceIDin__class__.sm_Dict.keys():
@@ -40,7 +41,8 @@ def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any:
4041
# --------------------------------------------------------------------
4142
defReleaseAllResources():
4243
assert__class__.sm_GuardisnotNone
43-
assertisinstance(__class__.sm_Dict,dict)
44+
assert__class__.sm_DictisnotNone
45+
asserttype(__class__.sm_Dict)==dict# noqa: E721
4446

4547
with__class__.sm_Guard:
4648
emptyDict:typing.Dict[str,any]=dict()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp