File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -327,3 +327,23 @@ def test_install_user_in_global_virtualenv_with_conflict_fails(
327
327
f"Will not install to the user site because it will lack sys.path "
328
328
f"precedence to pkg in { dist_location } "
329
329
) in result2 .stderr
330
+
331
+ def test_install_user_nositepkgs_fails (
332
+ self , script : PipTestEnvironment , data : TestData
333
+ ) -> None :
334
+ """
335
+ Test that --user install fails when user site-packages are disabled.
336
+ """
337
+ run_from = data .packages .joinpath ("FSPkg" )
338
+ result = script .pip (
339
+ "install" ,
340
+ "--user" ,
341
+ curdir ,
342
+ cwd = run_from ,
343
+ expect_error = True ,
344
+ env = {"PYTHONNOUSERSITE" : "1" },
345
+ )
346
+ assert (
347
+ "Can not perform a '--user' install. User site-packages are "
348
+ "disabled for this Python." in result .stderr
349
+ )
You can’t perform that action at this time.
0 commit comments