@@ -19,7 +19,7 @@ def pytest_virtualenv_works(venv):
1919 pytest_virtualenv may not work. if it doesn't, skip these
2020 tests. See #1284.
2121 """
22- venv_prefix = venv .run (["python" , "-c" , "import sys; print(sys.prefix)" ]).strip ()
22+ venv_prefix = venv .run (["python" , "-c" , "import sys; print(sys.prefix)" ]).strip ()
2323 if venv_prefix == sys .prefix :
2424 pytest .skip ("virtualenv is broken (see pypa/setuptools#1284)" )
2525
@@ -63,10 +63,11 @@ def access_pypi():
6363 'https://github.com/pypa/pip/archive/main.zip' ,
6464 marks = pytest .mark .xfail (reason = '#2975' ),
6565 ),
66- ]
66+ ],
6767)
68- def test_pip_upgrade_from_source (pip_version , venv_without_setuptools ,
69- setuptools_wheel , setuptools_sdist ):
68+ def test_pip_upgrade_from_source (
69+ pip_version , venv_without_setuptools , setuptools_wheel , setuptools_sdist
70+ ):
7071 """
7172 Check pip can upgrade setuptools from source.
7273 """
@@ -90,10 +91,12 @@ def _check_test_command_install_requirements(venv, tmpdir):
9091 """
9192 Check the test command will install all required dependencies.
9293 """
94+
9395 def sdist (distname , version ):
9496 dist_path = tmpdir .join ('%s-%s.tar.gz' % (distname , version ))
9597 make_nspkg_sdist (str (dist_path ), distname , version )
9698 return dist_path
99+
97100 dependency_links = [
98101 pathlib .Path (str (dist_path )).as_uri ()
99102 for dist_path in (
@@ -104,8 +107,9 @@ def sdist(distname, version):
104107 )
105108 ]
106109 with tmpdir .join ('setup.py' ).open ('w' ) as fp :
107- fp .write (DALS (
108- '''
110+ fp .write (
111+ DALS (
112+ '''
109113 from setuptools import setup
110114
111115 setup(
@@ -127,17 +131,24 @@ def sdist(distname, version):
127131 """,
128132 }}
129133 )
130- ''' .format (dependency_links = dependency_links )))
134+ ''' .format (
135+ dependency_links = dependency_links
136+ )
137+ )
138+ )
131139 with tmpdir .join ('test.py' ).open ('w' ) as fp :
132- fp .write (DALS (
133- '''
140+ fp .write (
141+ DALS (
142+ '''
134143 import foobar
135144 import bits
136145 import bobs
137146 import pieces
138147
139148 open('success', 'w').close()
140- ''' ))
149+ '''
150+ )
151+ )
141152
142153 cmd = ["python" , 'setup.py' , 'test' , '-s' , 'test' ]
143154 venv .run (cmd , cwd = str (tmpdir ))
0 commit comments