Commit 2d935019 authored by Benjamin Peterson's avatar Benjamin Peterson

make test_threading more robust for real

parent ec2576c0
......@@ -324,14 +324,12 @@ class ThreadTests(unittest.TestCase):
sys.getrefcount(weak_raising_cyclic_object())))
def test_pep8ified_threading(self):
import warnings
def check(_, w, msg):
self.assertEqual(str(w.message), msg)
t = threading.Thread()
with catch_warning() as w:
warnings.simplefilter("always", DeprecationWarning)
del threading.__warningregistry__
msg = "isDaemon() is deprecated in favor of the " \
"Thread.daemon property"
check(t.isDaemon(), w, msg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment