Skip to content

Update test context to avoid discovery of external Pythons - #4222

Merged
zanieb merged 1 commit into
mainfrom
zb/no-pythons
Jun 10, 2024
Merged

zanieb merged 1 commit into
mainfrom
zb/no-pythons

Conversation

@zanieb

@zanieb zanieb commented Jun 10, 2024 •

Copy link
Copy Markdown
Member

By setting the test search path to an empty path, we avoid accidentally pulling interpreters from the system during a test case.

Cherry-picked from #4214

By setting the test search path to an empty path, we avoid accidentally pulling interpreters from the system during a test case
@zanieb zanieb added the internal:testing Internal testing of behavior label Jun 10, 2024
@zanieb
zanieb marked this pull request as ready for review June 10, 2024 21:47
@zanieb
zanieb requested review from charliermarsh and konstin June 10, 2024 22:01
.arg(self.cache_dir.path())
.env("VIRTUAL_ENV", self.venv.as_os_str())
.env("UV_NO_WRAP", "1")
.env("UV_TEST_PYTHON_PATH", "/dev/null")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use empty string? Would it be more portable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried we might treat an empty string as an empty variable but I guess we don't after looking at the source. Since this passes on Windows CI I think I'd prefer to leave it as-is because the intent is clearer? 🤷‍♀️

@zanieb
zanieb merged commit 546e23b into main Jun 10, 2024
@zanieb
zanieb deleted the zb/no-pythons branch June 10, 2024 22:26
zanieb added a commit that referenced this pull request Jun 10, 2024
A merge kerfuffle from #4222  and #4218 

Now we fail because we genuinely can't find any interpreters since tests
contexts are isolated by default. I'll improve the error message and
maybe add another test case once `main` is fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal:testing Internal testing of behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants