From e4424116d6651e35f16806691664ddfbefacf5c6 Mon Sep 17 00:00:00 2001 From: Charles Machalow Date: Fri, 15 Sep 2023 15:06:40 -0700 Subject: [PATCH] Check -s for usercustomize --- Lib/test/test_site.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index f4b4337e06aff9..2fe8fab9dc8190 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -500,9 +500,15 @@ def test_customization_modules_on_startup(self): output = subprocess.check_output(f'{sys.executable} -c ""') self.assertIn(eyecatcher, output.decode('utf-8')) + # -S blocks any site-packages output = subprocess.check_output(f'{sys.executable} -S -c ""') self.assertNotIn(eyecatcher, output.decode('utf-8')) + # -s blocks user site-packages + if 'usercustomize' == module_name: + output = subprocess.check_output(f'{sys.executable} -s -c ""') + self.assertNotIn(eyecatcher, output.decode('utf-8')) + @unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"), 'need SSL support to download license') @test.support.requires_resource('network')