summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-10-08 11:31:35 (GMT)
committerGitHub <noreply@github.com>2019-10-08 11:31:35 (GMT)
commitd05b000c6bcd39dba4f4b2656e45954802649562 (patch)
treecc375d0d253bebcc72a73d805d8273bd3d870386 /Lib
parentd7c387384a27f37e4e3fa7890c859212c56b45b2 (diff)
downloadcpython-d05b000c6bcd39dba4f4b2656e45954802649562.zip
cpython-d05b000c6bcd39dba4f4b2656e45954802649562.tar.gz
cpython-d05b000c6bcd39dba4f4b2656e45954802649562.tar.bz2
bpo-38371: Tkinter: deprecate the split() method. (GH-16584)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_tcl.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 3183ea8..1c5b9cf 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -3,6 +3,7 @@ import re
import subprocess
import sys
import os
+import warnings
from test import support
# Skip this test if the _tkinter module wasn't built.
@@ -573,9 +574,12 @@ class TclTest(unittest.TestCase):
def test_split(self):
split = self.interp.tk.split
call = self.interp.tk.call
- self.assertRaises(TypeError, split)
- self.assertRaises(TypeError, split, 'a', 'b')
- self.assertRaises(TypeError, split, 2)
+ with warnings.catch_warnings():
+ warnings.filterwarnings('ignore', r'\bsplit\b.*\bsplitlist\b',
+ DeprecationWarning)
+ self.assertRaises(TypeError, split)
+ self.assertRaises(TypeError, split, 'a', 'b')
+ self.assertRaises(TypeError, split, 2)
testcases = [
('2', '2'),
('', ''),
@@ -617,7 +621,8 @@ class TclTest(unittest.TestCase):
expected),
]
for arg, res in testcases:
- self.assertEqual(split(arg), res, msg=arg)
+ with self.assertWarns(DeprecationWarning):
+ self.assertEqual(split(arg), res, msg=arg)
def test_splitdict(self):
splitdict = tkinter._splitdict