| 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() |