Skip to content

Commit dcd6907

Browse files
committed
docs: add comment explaining CWD manipulation in telemetry test
Clarify why os.chdir() is necessary: telemetry.py calls get_package_version() at module load time, which reads pyproject.toml using a relative path. Acknowledges the fragility while explaining why it's currently required.
1 parent 51750f0 commit dcd6907

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_telemetry_queue_worker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def _load_module(path: pathlib.Path, name: str):
4444

4545

4646
# Load real telemetry on top of stub (it will reuse stubbed helpers)
47+
# Note: CWD change required because telemetry.py calls get_package_version()
48+
# at module load time, which reads pyproject.toml using a relative path.
49+
# This is fragile but necessary given current telemetry module design.
4750
_prev_cwd = os.getcwd()
4851
os.chdir(str(SRC))
4952
try:

0 commit comments

Comments
 (0)