@@ -1965,16 +1965,20 @@ def test_dev_mode(self):
19651965 self .check_executed_tests (output , tests ,
19661966 stats = len (tests ), parallel = True )
19671967
1968- def check_reexec (self , option ):
1968+ def check_add_python_opts (self , option ):
19691969 # --fast-ci and --slow-ci add "-u -W default -bb -E" options to Python
19701970 code = textwrap .dedent (r"""
19711971 import sys
19721972 import unittest
1973+ from test import support
19731974 try:
19741975 from _testinternalcapi import get_config
19751976 except ImportError:
19761977 get_config = None
19771978
1979+ # WASI/WASM buildbots don't use -E option
1980+ use_environment = (support.is_emscripten or support.is_wasi)
1981+
19781982 class WorkerTests(unittest.TestCase):
19791983 @unittest.skipUnless(get_config is None, 'need get_config()')
19801984 def test_config(self):
@@ -1986,7 +1990,7 @@ def test_config(self):
19861990 # -bb option
19871991 self.assertTrue(config['bytes_warning'], 2)
19881992 # -E option
1989- self.assertTrue(config['use_environment'], 0 )
1993+ self.assertTrue(config['use_environment'], use_environment )
19901994
19911995 def test_python_opts(self):
19921996 # -u option
@@ -2000,7 +2004,8 @@ def test_python_opts(self):
20002004 self.assertEqual(sys.flags.bytes_warning, 2)
20012005
20022006 # -E option
2003- self.assertTrue(sys.flags.ignore_environment)
2007+ self.assertEqual(not sys.flags.ignore_environment,
2008+ use_environment)
20042009 """ )
20052010 testname = self .create_test (code = code )
20062011
@@ -2018,7 +2023,7 @@ def test_python_opts(self):
20182023 def test_add_python_opts (self ):
20192024 for opt in ("--fast-ci" , "--slow-ci" ):
20202025 with self .subTest (opt = opt ):
2021- self .check_reexec (opt )
2026+ self .check_add_python_opts (opt )
20222027
20232028
20242029class TestUtils (unittest .TestCase ):
0 commit comments