@@ -616,51 +616,6 @@ def test_BoundedSemaphore_limit(self):
616616 t .join ()
617617 self .assertRaises (ValueError , bs .release )
618618
619- def test_locals_at_exit (self ):
620- # Issue #19466: thread locals must not be deleted before destructors
621- # are called
622- rc , out , err = assert_python_ok ("-c" , """if 1:
623- import threading
624-
625- class Atexit:
626- def __del__(self):
627- print("thread_dict.atexit = %r" % thread_dict.atexit)
628-
629- thread_dict = threading.local()
630- thread_dict.atexit = "atexit"
631-
632- atexit = Atexit()
633- """ )
634- self .assertEqual (out .rstrip (), b"thread_dict.atexit = 'atexit'" )
635-
636- def test_warnings_at_exit (self ):
637- # Issue #19466: try to call most destructors at Python shutdown before
638- # destroying Python thread states
639- filename = __file__
640- rc , out , err = assert_python_ok ("-Wd" , "-c" , """if 1:
641- import time
642- import threading
643-
644- def open_sleep():
645- # a warning will be emitted when the open file will be
646- # destroyed (without being explicitly closed) while the daemon
647- # thread is destroyed
648- fileobj = open(%a, 'rb')
649- start_event.set()
650- time.sleep(60.0)
651-
652- start_event = threading.Event()
653-
654- thread = threading.Thread(target=open_sleep)
655- thread.daemon = True
656- thread.start()
657-
658- # wait until the thread started
659- start_event.wait()
660- """ % filename )
661- self .assertRegex (err .rstrip (),
662- b"^sys:1: ResourceWarning: unclosed file " )
663-
664619 @cpython_only
665620 def test_frame_tstate_tracing (self ):
666621 # Issue #14432: Crash when a generator is created in a C thread that is
@@ -786,10 +741,6 @@ def test_4_daemon_threads(self):
786741 import sys
787742 import time
788743 import threading
789- import warnings
790-
791- # ignore "unclosed file ..." warnings
792- warnings.filterwarnings('ignore', '', ResourceWarning)
793744
794745 thread_has_run = set()
795746
0 commit comments