aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-05-15 05:57:10 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-05-15 05:57:10 -0400
commit2187d0c770de3a93f9a6cdcf53d9a217167dcc83 (patch)
treef95973b8e73aa1991f1feff7d586009c35529955 /setuptools/tests
parentf6f25adfc81df76e186bf6c3738a1baa0f92be05 (diff)
downloadexternal_python_setuptools-2187d0c770de3a93f9a6cdcf53d9a217167dcc83.tar.gz
external_python_setuptools-2187d0c770de3a93f9a6cdcf53d9a217167dcc83.tar.bz2
external_python_setuptools-2187d0c770de3a93f9a6cdcf53d9a217167dcc83.zip
Extract fixture for a temp home
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_packageindex.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index c6016c09..7b7815ab 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -283,10 +283,15 @@ class TestContentCheckers:
assert rep == 'My message about md5'
+@pytest.fixture
+def temp_home(tmpdir, monkeypatch):
+ monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
+ return tmpdir
+
+
class TestPyPIConfig:
- def test_percent_in_password(self, tmpdir, monkeypatch):
- monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
- pypirc = tmpdir / '.pypirc'
+ def test_percent_in_password(self, temp_home):
+ pypirc = temp_home / '.pypirc'
pypirc.write(DALS("""
[pypi]
repository=https://pypi.org