Skip to content

bpo-30027: Fix Py3k warnings in test_xml_etree. #1065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Lib/test/test_xml_etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@ class X(ET.Element):
def __eq__(self, o):
del e[:]
return False
__hash__ = object.__hash__
e = ET.Element('foo')
e.extend([X('bar')])
self.assertRaises(ValueError, e.remove, ET.Element('baz'))
Expand Down Expand Up @@ -1679,12 +1680,12 @@ def __new__(cls, elem, *args):
def __eq__(self, o):
del self.elem[:]
return True
MutatingElementPath.__hash__ = str.__hash__
__hash__ = str.__hash__

class BadElementPath(str):
def __eq__(self, o):
raise 1/0
BadElementPath.__hash__ = str.__hash__
raise 1.0/0.0
__hash__ = str.__hash__

class BadElementPathTest(unittest.TestCase):
def setUp(self):
Expand Down