| 654 | sys.getrefcount(weak_raising_cyclic_object()))) |
| 655 | |
| 656 | def test_old_threading_api(self): |
| 657 | # Just a quick sanity check to make sure the old method names are |
| 658 | # still present |
| 659 | t = threading.Thread() |
| 660 | with self.assertWarnsRegex(DeprecationWarning, |
| 661 | r'get the daemon attribute'): |
| 662 | t.isDaemon() |
| 663 | with self.assertWarnsRegex(DeprecationWarning, |
| 664 | r'set the daemon attribute'): |
| 665 | t.setDaemon(True) |
| 666 | with self.assertWarnsRegex(DeprecationWarning, |
| 667 | r'get the name attribute'): |
| 668 | t.getName() |
| 669 | with self.assertWarnsRegex(DeprecationWarning, |
| 670 | r'set the name attribute'): |
| 671 | t.setName("name") |
| 672 | |
| 673 | e = threading.Event() |
| 674 | with self.assertWarnsRegex(DeprecationWarning, 'use is_set()'): |
| 675 | e.isSet() |
| 676 | |
| 677 | cond = threading.Condition() |
| 678 | cond.acquire() |
| 679 | with self.assertWarnsRegex(DeprecationWarning, 'use notify_all()'): |
| 680 | cond.notifyAll() |
| 681 | |
| 682 | with self.assertWarnsRegex(DeprecationWarning, 'use active_count()'): |
| 683 | threading.activeCount() |
| 684 | with self.assertWarnsRegex(DeprecationWarning, 'use current_thread()'): |
| 685 | threading.currentThread() |
| 686 | |
| 687 | def test_repr_daemon(self): |
| 688 | t = threading.Thread() |