test: assert endpoint config freshness by identity instead of mutating it

The previous check proved _load_endpoints_config returns a fresh object by
clearing the first result and reloading. That mutates shared state and only
works while the loader happens not to cache, so a future cache would corrupt
every later test rather than fail this one.

Compare the two loads by identity and equality instead. Verified red-before-green:
adding a module-level cache to the loader fails this test, removing it passes.
This commit is contained in:
Yuneng Jiang 2026-08-28 10:11:55 -07:00
parent 0bba7f8869
commit 5928556c16
No known key found for this signature in database

View file

@ -47,8 +47,10 @@ class TestEndpointsConfig:
def test_config_is_reread_rather_than_shared_between_callers(self):
first = _load_endpoints_config()
first["endpoints"].clear()
assert len(_load_endpoints_config()["endpoints"]) == len(_SYNC_NAMES)
second = _load_endpoints_config()
assert first is not second
assert first["endpoints"] is not second["endpoints"]
assert first == second
class TestResponseTypeMapping: