Skip to content

Commit

Permalink
Show that generator needs to be consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 25, 2024
1 parent 338537e commit fddb547
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/unittests/general/bulkparse_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for bulkparse"""

# pylint: disable=C0111, C0103, W0614

import pytest

from nav import bulkparse
Expand Down Expand Up @@ -84,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)
out_data = list(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 fddb547

Please sign in to comment.