On Windows, tests/unit/test_shared_functions.py::test_abs_lambda_path_empty_envvar fails on an unmodified develop checkout (3bd47e2):
assert abs_lambda_path() == default_lambda_path
AssertionError: assert '\var\task' == '/var/task'
abs_lambda_path() builds its result with pathlib.Path, which is WindowsPath off-Linux and rewrites the separators. LAMBDA_TASK_ROOT is always POSIX-shaped because the runtime is Linux, so the value the docstring says is returned unchanged comes back as \var\task.
Deployed functions are unaffected. What it does affect is contributors running the suite on Windows, and the Redis-certs example in docs/utilities/idempotency.md, which interpolates f"{abs_lambda_path()}/certs/..." and so yields mixed separators. Your workflows are ubuntu-latest only, so CI cannot see either.
Possible solution: use PurePosixPath when LAMBDA_TASK_ROOT is set, keeping Path.cwd() for the unset case. test_abs_lambda_path_w_filename_envvar also needs its oracle corrected, since it currently builds the expected value with the same Path call. I have both working locally and can open a PR if useful.
To reproduce: check out develop on Windows and run pytest tests/unit/test_shared_functions.py -k abs_lambda_path.
AI-assisted; I reproduced this and ran the suite myself.
On Windows,
tests/unit/test_shared_functions.py::test_abs_lambda_path_empty_envvarfails on an unmodifieddevelopcheckout (3bd47e2):abs_lambda_path()builds its result withpathlib.Path, which isWindowsPathoff-Linux and rewrites the separators.LAMBDA_TASK_ROOTis always POSIX-shaped because the runtime is Linux, so the value the docstring says is returned unchanged comes back as\var\task.Deployed functions are unaffected. What it does affect is contributors running the suite on Windows, and the Redis-certs example in
docs/utilities/idempotency.md, which interpolatesf"{abs_lambda_path()}/certs/..."and so yields mixed separators. Your workflows areubuntu-latestonly, so CI cannot see either.Possible solution: use
PurePosixPathwhenLAMBDA_TASK_ROOTis set, keepingPath.cwd()for the unset case.test_abs_lambda_path_w_filename_envvaralso needs its oracle corrected, since it currently builds the expected value with the samePathcall. I have both working locally and can open a PR if useful.To reproduce: check out
developon Windows and runpytest tests/unit/test_shared_functions.py -k abs_lambda_path.AI-assisted; I reproduced this and ran the suite myself.