Rely on pytest-home for the alternate home directory.#4072
Merged
Conversation
Member
Author
|
I also tried applying the change to test_easy_install with: diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index d71e0158..b8a066b8 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -1394,7 +1394,9 @@ def test_use_correct_python_version_string(tmpdir, tmpdir_cwd, monkeypatch):
assert cmd.config_vars['py_version_nodot'] == '310'
-def test_editable_user_and_build_isolation(setup_context, monkeypatch, tmp_path):
+def test_editable_user_and_build_isolation(
+ setup_context, monkeypatch, tmp_path, alt_home
+):
'''`setup.py develop` should honor `--user` even under build isolation'''
# == Arrange ==
@@ -1420,9 +1422,7 @@ def test_editable_user_and_build_isolation(setup_context, monkeypatch, tmp_path)
#
# 2. We are going to force `site` to update site.USER_BASE and site.USER_SITE
# To point inside our new home
- monkeypatch.setenv('HOME', str(tmp_path / '.home'))
- monkeypatch.setenv('USERPROFILE', str(tmp_path / '.home'))
- monkeypatch.setenv('APPDATA', str(tmp_path / '.home'))
+ monkeypatch.setenv('APPDATA', str(alt_home))
monkeypatch.setattr('site.USER_BASE', None)
monkeypatch.setattr('site.USER_SITE', None)
user_site = Path(site.getusersitepackages())But when I did, the tests fail with a Sandbox violation. It seems the existing test is relying on the fact that the setup script is in |
d43776d to
0a5d8da
Compare
0a5d8da to
5c71837
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Closes
Pull Request Checklist
newsfragments/.(See documentation for details)