summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-01 11:36:16 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-01 11:36:16 -0500
commit82dabc7c76fb27898bfa864ecc8f8558949269c3 (patch)
tree879fe338f80c55a581c26a9481ebd7159bf32409 /bs4/tests/test_tree.py
parentcb5b71d9d90f6d3fb70eb9fca297d4e12dda3a3f (diff)
Generators no longer yield None after going off the end of the iteration.
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py16
1 files changed, 3 insertions, 13 deletions
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 <b> 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 <b> tag containing "One"
- # the <body> tag, the <head> tag, and the <html> tag. Then we
- # go off the end.
- b, body, head, html, none = predecessors
+ # the <body> tag, the <head> tag, and the <html> 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):