Skip to content

Commit 4470293

Browse files
ZhiXiao-Linclaude
andauthored
test(bootstrap): make cache-dir assertion version-agnostic (#48)
ensure_native_loaded's cache dir is keyed on the module's __version__, not the version argument. The test hardcoded "3.2.1", so the 3.3.0 version bump broke it and blocked the publish-python-bootstrap job (which runs the bootstrap unit tests before twine upload), which in turn skipped github-release. Reference _bootstrap.__version__ directly, matching the sibling CacheDirTests, so the assertion can't go stale on future bumps. Co-authored-by: Claude <claude@anthropic.com>
1 parent d2ed389 commit 4470293

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sdk/python-bootstrap/tests/test_bootstrap.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ def fake_get(url: str) -> bytes:
186186
):
187187
cache = _bootstrap.ensure_native_loaded("3.2.1")
188188

189-
self.assertEqual(cache, Path(self._tmp) / "3.2.1")
189+
# `_cache_root()` keys the cache dir on the module's own __version__,
190+
# not the version arg passed to `ensure_native_loaded`. Reference it
191+
# directly so this assertion can't go stale on a version bump (the
192+
# sibling CacheDirTests follow the same pattern).
193+
self.assertEqual(cache, Path(self._tmp) / _bootstrap.__version__)
190194
# Native file extracted at cache root, not under a subdirectory.
191195
extracted = list(cache.glob("_native.*"))
192196
self.assertEqual(len(extracted), 1)

0 commit comments

Comments
 (0)