summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2010-06-09 08:13:42 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2010-06-09 08:13:42 (GMT)
commit17173cfe7b5f880c02a8f9468f17607ec84e5b39 (patch)
tree51a9e201ac3e86ad153505c8da15b4229f5f39f3 /Lib/test
parent3dcb5acdb0151d1686762329ec07ae2ac4d1caae (diff)
downloadcpython-17173cfe7b5f880c02a8f9468f17607ec84e5b39.zip
cpython-17173cfe7b5f880c02a8f9468f17607ec84e5b39.tar.gz
cpython-17173cfe7b5f880c02a8f9468f17607ec84e5b39.tar.bz2
http://bugs.python.org/issue8832
Issue minidom.unlink with a context manager
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_minidom.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 32863bf..9a9acfb 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -228,7 +228,14 @@ class MinidomTest(unittest.TestCase):
def testUnlink(self):
dom = parse(tstfile)
+ self.assertTrue(dom.childNodes)
dom.unlink()
+ self.assertFalse(dom.childNodes)
+
+ def testContext(self):
+ with parse(tstfile) as dom:
+ self.assertTrue(dom.childNodes)
+ self.assertFalse(dom.childNodes)
def testElement(self):
dom = Document()