summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-13 13:26:31 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-01-13 13:26:31 (GMT)
commita50ff1887d706ff193b698013931516307972382 (patch)
treecd27322e99348d8d3358908e112fbb0bb49a81b1 /Lib/test
parente5bdfef74289ce946d33b489a3c9e4db7b673d77 (diff)
parent25771b3749cac588ad2ecc8fc796a496d35769e5 (diff)
downloadcpython-a50ff1887d706ff193b698013931516307972382.zip
cpython-a50ff1887d706ff193b698013931516307972382.tar.gz
cpython-a50ff1887d706ff193b698013931516307972382.tar.bz2
Issue #16922: fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_xml_etree.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 59a8508..b4edd74 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1773,6 +1773,9 @@ class ElementFindTest(unittest.TestCase):
self.assertIsNone(e.findtext('tog'))
self.assertEqual(e.findtext('tog', 'default'), 'default')
+ # Issue #16922
+ self.assertEqual(ET.XML('<tag><empty /></tag>').findtext('empty'), '')
+
def test_findall(self):
e = ET.XML(SAMPLE_XML)
e[2] = ET.XML(SAMPLE_SECTION)