Skip to content

Commit

Permalink
Check raise StopIteration (not return None) in Bio.SeqIO (Bug 3147)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc committed Oct 20, 2010
1 parent 208d926 commit 246bd42
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Tests/test_SeqIO.py
Expand Up @@ -444,15 +444,10 @@ def check_simple_write_read(records, indent=" "):
try:
record = seq_iterator.next()
except StopIteration:
record = None
#Note that if the SeqRecord class has a __len__ method,
#and it has a zero-length sequence, this would fail an
#"if record" test.
if record is not None:
records3.append(record)
else:
break

assert record is not None, "Should raise StopIteration not return None"
records3.append(record)

#Try a mixture of next() and list (a torture test!)
seq_iterator = SeqIO.parse(handle=open(t_filename,mode), format=t_format)
try:
Expand Down

0 comments on commit 246bd42

Please sign in to comment.