Skip to content

Commit 93ac812

Browse files
derek73claude
andcommitted
test: add identity assertion to cache performance test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 248423b commit 93ac812

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ class SuffixesPrefixesTitlesPerformanceTests(HumanNameTestBase):
247247

248248
def test_repeated_access_is_cached(self) -> None:
249249
c = Constants()
250-
# Prime the cache with one access.
251-
_ = c.suffixes_prefixes_titles
250+
first = c.suffixes_prefixes_titles
251+
second = c.suffixes_prefixes_titles
252+
assert first is second, "suffixes_prefixes_titles should return the same cached object on repeated access"
252253

253254
n = 10_000
254255
elapsed = timeit.timeit(lambda: c.suffixes_prefixes_titles, number=n)

0 commit comments

Comments
 (0)