@@ -425,6 +425,7 @@ def test_getwindowsversion(self):
425425 self .assertEqual (v [2 ], v .build )
426426 self .assertEqual (v [3 ], v .platform )
427427 self .assertEqual (v [4 ], v .service_pack )
428+ support .check_immutable_type (self , type (v ))
428429
429430 # This is how platform.py calls it. Make sure tuple
430431 # still has 5 elements
@@ -690,6 +691,7 @@ def test_attributes(self):
690691 self .assertEqual (algo , 0 )
691692 self .assertGreaterEqual (sys .hash_info .cutoff , 0 )
692693 self .assertLess (sys .hash_info .cutoff , 8 )
694+ support .check_immutable_type (self , type (sys .hash_info ))
693695
694696 self .assertIsInstance (sys .maxsize , int )
695697 self .assertIsInstance (sys .maxunicode , int )
@@ -893,11 +895,13 @@ def assert_raise_on_new_sys_type(self, sys_attr):
893895 # sys.flags, sys.version_info, and sys.getwindowsversion.
894896 support .check_disallow_instantiation (self , type (sys_attr ), sys_attr )
895897
896- def test_sys_flags_no_instantiation (self ):
898+ def test_sys_flags_type (self ):
897899 self .assert_raise_on_new_sys_type (sys .flags )
900+ support .check_immutable_type (self , type (sys .flags ))
898901
899- def test_sys_version_info_no_instantiation (self ):
902+ def test_sys_version_info_type (self ):
900903 self .assert_raise_on_new_sys_type (sys .version_info )
904+ support .check_immutable_type (self , type (sys .version_info ))
901905
902906 def test_sys_getwindowsversion_no_instantiation (self ):
903907 # Skip if not being run on Windows.
@@ -1954,6 +1958,7 @@ def test_asyncgen_hooks(self):
19541958 cur = sys .get_asyncgen_hooks ()
19551959 self .assertIsNone (cur .firstiter )
19561960 self .assertIsNone (cur .finalizer )
1961+ support .check_immutable_type (self , type (cur ))
19571962
19581963 # gh-118473
19591964 with self .assertRaises (TypeError ):
@@ -1997,6 +2002,7 @@ def write(self, s):
19972002 self .assertEqual (out , b"" )
19982003 self .assertEqual (err , b"" )
19992004
2005+
20002006@test .support .support_remote_exec_only
20012007@test .support .cpython_only
20022008class TestRemoteExec (unittest .TestCase ):
0 commit comments