test: pin the hit-path copy guard on the provider snapshot cache
The existing test only mutated the miss-path return; a mutation to 'return _PROVIDER_LIST_CACHE' (aliasing the global cache) survived the suite. One line pins the cached-return copy. Mutation-checked.
This commit is contained in:
@@ -46,6 +46,11 @@ def test_list_providers_reuses_cached_snapshot_until_registration_changes():
|
||||
|
||||
assert providers.list_providers() == [first]
|
||||
|
||||
# Hit-path copy guard: mutating a CACHED return must not corrupt the
|
||||
# module-level snapshot for later callers (aliasing bug class).
|
||||
providers.list_providers().clear()
|
||||
assert providers.list_providers() == [first]
|
||||
|
||||
second = _profile("beta")
|
||||
providers.register_provider(second)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user