Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f12be1

Browse files
committed
#18465: fix unused variables in test_minidom. Patch by Vajrasky Kok.
1 parent 1d237e5 commit 0f12be1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/test/test_minidom.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# test for xml.dom.minidom
22

33
import pickle
4-
from test.support import verbose, run_unittest, findfile
4+
from test.support import run_unittest, findfile
55
import unittest
66

77
import xml.dom.minidom
@@ -310,9 +310,10 @@ def testRemoveAttributeNode(self):
310310
self.confirm(len(child.attributes) == 0
311311
and child.getAttributeNode("spam") is None)
312312
dom2 = Document()
313-
child2 = dom2.appendChild(dom.createElement("foo"))
314-
self.assertRaises(xml.dom.NotFoundErr, child.removeAttributeNode,
315-
node)
313+
child2 = dom2.appendChild(dom2.createElement("foo"))
314+
node2 = child2.getAttributeNode("spam")
315+
self.assertRaises(xml.dom.NotFoundErr, child2.removeAttributeNode,
316+
node2)
316317
dom.unlink()
317318

318319
def testHasAttribute(self):
@@ -607,7 +608,7 @@ def testFirstChild(self): pass
607608
def testHasChildNodes(self):
608609
dom = parseString("<doc><foo/></doc>")
609610
doc = dom.documentElement
610-
self.assertTrue(dom.hasChildNodes())
611+
self.assertTrue(doc.hasChildNodes())
611612
dom2 = parseString("<doc/>")
612613
doc2 = dom2.documentElement
613614
self.assertFalse(doc2.hasChildNodes())

0 commit comments

Comments
 (0)