MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_old_threading_api

Method test_old_threading_api

Lib/test/test_threading.py:607–636  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

605 sys.getrefcount(weak_raising_cyclic_object())))
606
607 def test_old_threading_api(self):
608 # Just a quick sanity check to make sure the old method names are
609 # still present
610 t = threading.Thread()
611 with self.assertWarnsRegex(DeprecationWarning,
612 r'get the daemon attribute'):
613 t.isDaemon()
614 with self.assertWarnsRegex(DeprecationWarning,
615 r'set the daemon attribute'):
616 t.setDaemon(True)
617 with self.assertWarnsRegex(DeprecationWarning,
618 r'get the name attribute'):
619 t.getName()
620 with self.assertWarnsRegex(DeprecationWarning,
621 r'set the name attribute'):
622 t.setName("name")
623
624 e = threading.Event()
625 with self.assertWarnsRegex(DeprecationWarning, 'use is_set()'):
626 e.isSet()
627
628 cond = threading.Condition()
629 cond.acquire()
630 with self.assertWarnsRegex(DeprecationWarning, 'use notify_all()'):
631 cond.notifyAll()
632
633 with self.assertWarnsRegex(DeprecationWarning, 'use active_count()'):
634 threading.activeCount()
635 with self.assertWarnsRegex(DeprecationWarning, 'use current_thread()'):
636 threading.currentThread()
637
638 def test_repr_daemon(self):
639 t = threading.Thread()

Callers

nothing calls this directly

Calls 10

isDaemonMethod · 0.95
setDaemonMethod · 0.95
getNameMethod · 0.95
setNameMethod · 0.95
isSetMethod · 0.95
notifyAllMethod · 0.95
assertWarnsRegexMethod · 0.80
EventMethod · 0.80
ConditionMethod · 0.45
acquireMethod · 0.45

Tested by

no test coverage detected