File tree 1 file changed +18
-12
lines changed 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -287,35 +287,41 @@ def test_install_user_conflict_in_globalsite_and_usersite(
287
287
assert isdir (dist_info_folder )
288
288
assert isdir (initools_folder )
289
289
290
- @pytest .mark .network
291
290
def test_install_user_in_global_virtualenv_with_conflict_fails (
292
291
self , script : PipTestEnvironment
293
292
) -> None :
294
293
"""
295
294
Test user install in --system-site-packages virtualenv with conflict in
296
295
site fails.
297
296
"""
297
+ create_basic_wheel_for_package (script , "pkg" , "0.1" )
298
+ create_basic_wheel_for_package (script , "pkg" , "0.2" )
298
299
299
- script .pip ("install" , "INITools==0.2" )
300
+ script .pip (
301
+ "install" ,
302
+ "--no-index" ,
303
+ "--find-links" ,
304
+ script .scratch_path ,
305
+ "pkg==0.2" ,
306
+ )
300
307
301
308
result2 = script .pip (
302
309
"install" ,
310
+ "--no-index" ,
311
+ "--find-links" ,
312
+ script .scratch_path ,
303
313
"--user" ,
304
- "INITools ==0.1" ,
314
+ "pkg ==0.1" ,
305
315
expect_error = True ,
306
316
)
307
317
resultp = script .run (
308
318
"python" ,
309
319
"-c" ,
310
- "import pkg_resources; print(pkg_resources.get_distribution "
311
- "('initools ').location)" ,
320
+ "from pip._internal.metadata import get_default_environment; "
321
+ "print(get_default_environment().get_distribution('pkg ').location)" ,
312
322
)
313
323
dist_location = resultp .stdout .strip ()
314
324
assert (
315
- "Will not install to the user site because it will lack sys.path "
316
- "precedence to {name} in {location}" .format (
317
- name = "INITools" ,
318
- location = dist_location ,
319
- )
320
- in result2 .stderr
321
- )
325
+ f"Will not install to the user site because it will lack sys.path "
326
+ f"precedence to pkg in { dist_location } "
327
+ ) in result2 .stderr
You can’t perform that action at this time.
0 commit comments