@@ -2230,10 +2230,7 @@ def test_unload_tests(self):
22302230 self .check_executed_tests (output , tests , stats = 3 )
22312231
22322232 def check_add_python_opts (self , option ):
2233- # --fast-ci and --slow-ci add "-u -W default -bb -E" options to Python
2234-
2235- # Skip test if _testinternalcapi is missing
2236- import_helper .import_module ('_testinternalcapi' )
2233+ # --fast-ci and --slow-ci add "-u -W error -bb -E" options to Python
22372234
22382235 code = textwrap .dedent (r"""
22392236 import sys
@@ -2248,25 +2245,26 @@ def check_add_python_opts(self, option):
22482245 use_environment = (support.is_emscripten or support.is_wasi)
22492246
22502247 class WorkerTests(unittest.TestCase):
2251- @unittest.skipUnless (config_get is None, 'need config_get()')
2248+ @unittest.skipIf (config_get is None, 'need config_get()')
22522249 def test_config(self):
2253- config = config_get()
22542250 # -u option
22552251 self.assertEqual(config_get('buffered_stdio'), 0)
2256- # -W default option
2257- self.assertTrue(config_get('warnoptions'), ['default'])
2252+ # -W error option
2253+ self.assertEqual(config_get('warnoptions'),
2254+ ['error', 'error::BytesWarning'])
22582255 # -bb option
2259- self.assertTrue (config_get('bytes_warning'), 2)
2256+ self.assertEqual (config_get('bytes_warning'), 2)
22602257 # -E option
2261- self.assertTrue (config_get('use_environment'), use_environment)
2258+ self.assertEqual (config_get('use_environment'), use_environment)
22622259
22632260 def test_python_opts(self):
22642261 # -u option
22652262 self.assertTrue(sys.__stdout__.write_through)
22662263 self.assertTrue(sys.__stderr__.write_through)
22672264
2268- # -W default option
2269- self.assertTrue(sys.warnoptions, ['default'])
2265+ # -W error option
2266+ self.assertEqual(sys.warnoptions,
2267+ ['error', 'error::BytesWarning'])
22702268
22712269 # -bb option
22722270 self.assertEqual(sys.flags.bytes_warning, 2)
0 commit comments