def test_current_iterator(self, fasta_empty): fasta_reader = Reader(fasta_empty) assert fasta_reader._current_iterator is None iterator = fasta_reader.__iter__() assert fasta_reader._current_iterator == iterator try: # test if is iterable iter(fasta_reader._current_iterator) except TypeError: pytest.fail('Reader._current_iterator is not iterable.')
def test_closed_file(self, fasta_empty): fasta_reader = Reader(fasta_empty) fasta_empty.close() with pytest.raises(TypeError): fasta_reader.__iter__()