summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-09-01 23:09:31 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-09-01 23:09:31 (GMT)
commitb3085c9e2610943a2c7c038ff7e25639300463fd (patch)
treeaf358620e326cff05c7c3eaed873d265596dae3e /Lib/test/test_threading.py
parentf82b856b2ae519d857148b034f2d9ef71988548d (diff)
downloadcpython-b3085c9e2610943a2c7c038ff7e25639300463fd.zip
cpython-b3085c9e2610943a2c7c038ff7e25639300463fd.tar.gz
cpython-b3085c9e2610943a2c7c038ff7e25639300463fd.tar.bz2
remove the deprecation warnings for the old threading API; update the docs
Reviewer: Benjamin Peterson
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py48
1 files changed, 11 insertions, 37 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index c6a5cf4..775e312 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -323,44 +323,18 @@ class ThreadTests(unittest.TestCase):
msg=('%d references still around' %
sys.getrefcount(weak_raising_cyclic_object())))
- def test_pep8ified_threading(self):
- def check(_, w, msg):
- self.assertEqual(str(w.message), msg)
-
+ def test_old_threading_api(self):
+ # Just a quick sanity check to make sure the old method names are
+ # still present
t = threading.Thread()
- with catch_warning() as w:
- try:
- del threading.__warningregistry__
- except AttributeError:
- pass
- msg = "isDaemon() is deprecated in favor of the " \
- "Thread.daemon property"
- check(t.isDaemon(), w, msg)
- w.reset()
- msg = "setDaemon() is deprecated in favor of the " \
- "Thread.daemon property"
- check(t.setDaemon(True), w, msg)
- w.reset()
- msg = "getName() is deprecated in favor of the " \
- "Thread.name property"
- check(t.getName(), w, msg)
- w.reset()
- msg = "setName() is deprecated in favor of the " \
- "Thread.name property"
- check(t.setName("name"), w, msg)
- w.reset()
- msg = "isAlive() is deprecated in favor of is_alive()"
- check(t.isAlive(), w, msg)
- w.reset()
- e = threading.Event()
- msg = "isSet() is deprecated in favor of is_set()"
- check(e.isSet(), w, msg)
- w.reset()
- msg = "currentThread() is deprecated in favor of current_thread()"
- check(threading.currentThread(), w, msg)
- w.reset()
- msg = "activeCount() is deprecated in favor of active_count()"
- check(threading.activeCount(), w, msg)
+ t.isDaemon()
+ t.setDaemon(True)
+ t.getName()
+ t.setName("name")
+ t.isAlive()
+ e = threading.Event()
+ e.isSet()
+ threading.activeCount()
class ThreadJoinOnShutdown(unittest.TestCase):