Skip to content

Commit

Permalink
Add comment why generator needs to be consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 15, 2024
1 parent cb00108 commit 3849f10
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/unittests/general/bulkparse_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""Tests for bulkparse"""

# pylint: disable=C0111, C0103, W0614

import itertools

import pytest

from nav import bulkparse
Expand Down Expand Up @@ -86,7 +83,7 @@ def test_three_lines_with_two_rows_should_be_counted_as_three(self):
b"room1:10.0.0.187:myorg:OTHER:SNMP v2c read profile::\n"
)
b = bulkparse.NetboxBulkParser(data)
itertools.consume(b)
list(b) # Generator needs to be consumed for this test to succeed
assert b.line_num == 3

def test_short_line_should_raise_error(self):
Expand Down

0 comments on commit 3849f10

Please sign in to comment.