Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b60b9b7

Browse files
authored
Use assertRaises in test_iter
1 parent 978c083 commit b60b9b7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/chainz_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ def test_iter(self):
1515
it = iter(a)
1616
self.assertEqual(next(it), 0)
1717
self.assertEqual(next(it), 1)
18-
try:
18+
with self.assertRaises(StopIteration):
1919
next(it)
20-
except StopIteration:
21-
pass
22-
else:
23-
self.fail()
2420

2521
def test_next(self):
2622
a = Chain(range(2))

0 commit comments

Comments
 (0)