We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f874691 commit cf7806cCopy full SHA for cf7806c
bpython/test/test_repl.py
@@ -1,4 +1,6 @@
1
import unittest
2
+import itertools
3
+
4
from bpython import repl
5
6
@@ -62,13 +64,8 @@ def test_MatchesIterator(self):
62
64
# should be falsey before we enter (i.e. 'not active')
63
65
self.assertEqual(bool(matches_iterator), False)
66
- matched = []
- for i, x in enumerate(matches_iterator):
67
- matched.append(x)
68
- if i == 8:
69
- break
70
-
71
- self.assertEqual(matched, matches * 3)
+ slice = itertools.islice(matches_iterator, 0, 9)
+ self.assertEqual(list(slice),matches * 3)
72
73
# should be truthy once we have an active match
74
self.assertEqual(bool(matches_iterator), True)
0 commit comments