M python 2/koans/about_generators.py +7 -0
@@ 123,4 123,11 @@ class AboutGenerators(Koan):
next(generator2)
self.assertEqual(__, next(generator2))
+ def test_send_none_is_equivelant_to_next(self):
+ generator = self.yield_tester()
+
+ next(generator)
+ # 'next(generator)' is exactly equivelant to 'generator.send(None)'
+ self.assertEqual(__, generator.send(None))
+
M python 3/koans/about_generators.py +8 -1
@@ 126,4 126,11 @@ class AboutGenerators(Koan):
next(generator2)
self.assertEqual(__, next(generator2))
-
No newline at end of file
+ def test_send_none_is_equivelant_to_next(self):
+ generator = self.yield_tester()
+
+ next(generator)
+ # 'next(generator)' is exactly equivelant to 'generator.send(None)'
+ self.assertEqual(__, generator.send(None))
+
+