From 82dabc7c76fb27898bfa864ecc8f8558949269c3 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 1 Feb 2012 11:36:16 -0500 Subject: Generators no longer yield None after going off the end of the iteration. --- bs4/tests/test_tree.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'bs4/tests/test_tree.py') diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index f14a746..60b9b91 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -357,15 +357,9 @@ class TestNextOperations(ProximityTest): start = self.tree.find(text="Two") successors = [node for node in start.next_elements] # There are two successors: the final tag and its text contents. - # Then we go off the end. - tag, contents, none = successors + tag, contents = successors self.assertEqual(tag['id'], '3') self.assertEqual(contents, "Three") - self.assertEqual(none, None) - - # XXX Should next_elements really return None? Seems like it - # should just stop. - class TestPreviousOperations(ProximityTest): @@ -410,16 +404,12 @@ class TestPreviousOperations(ProximityTest): predecessors = [node for node in start.previous_elements] # There are four predecessors: the tag containing "One" - # the tag, the tag, and the tag. Then we - # go off the end. - b, body, head, html, none = predecessors + # the tag, the tag, and the tag. + b, body, head, html = predecessors self.assertEqual(b['id'], '1') self.assertEqual(body.name, "body") self.assertEqual(head.name, "head") self.assertEqual(html.name, "html") - self.assertEqual(none, None) - - # Again, we shouldn't be returning None. class SiblingTest(TreeTest): -- cgit v1.2.3