summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-22 10:42:50 (GMT)
committerGitHub <noreply@github.com>2025-05-22 10:42:50 (GMT)
commitdb98e0bb127c469842dc119d23e5daacd23862cc (patch)
tree5628e04625c93f2e5bde25aa29dedb3c154a0dec /Lib/test/test_xml_etree.py
parentd5f7e80d4407655919b32bbd5746b23af174bc5b (diff)
downloadcpython-db98e0bb127c469842dc119d23e5daacd23862cc.zip
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.gz
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.bz2
[3.14] gh-71339: Use new assertion methods in tests (GH-129046) (GH-134498)
(cherry picked from commit 2602d8ae981c4bae1cada2c174b367d97f712efb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r--Lib/test/test_xml_etree.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 8f27795..38be2cd 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -225,8 +225,7 @@ class ElementTreeTest(unittest.TestCase):
self.assertTrue(ET.iselement(element), msg="not an element")
direlem = dir(element)
for attr in 'tag', 'attrib', 'text', 'tail':
- self.assertTrue(hasattr(element, attr),
- msg='no %s member' % attr)
+ self.assertHasAttr(element, attr)
self.assertIn(attr, direlem,
msg='no %s visible by dir' % attr)
@@ -251,7 +250,7 @@ class ElementTreeTest(unittest.TestCase):
# Make sure all standard element methods exist.
def check_method(method):
- self.assertTrue(hasattr(method, '__call__'),
+ self.assertHasAttr(method, '__call__',
msg="%s not callable" % method)
check_method(element.append)