Skip to content

Commit

Permalink
Use yield in fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
lszeremeta committed Oct 20, 2020
1 parent 7992483 commit 6c5f8b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

@pytest.fixture
def csv_reader():
"""Open test file and return csv.DictReader."""
return csv.DictReader(open(os.path.join(HERE, "drugbank_vocabulary_CC0_first_20_sample.csv"), 'r'))
"""Open test file and prepare csv.DictReader."""
with open(os.path.join(HERE, "drugbank_vocabulary_CC0_first_20_sample.csv"), 'r') as csvfile:
yield csv.DictReader(csvfile)


#
Expand Down

0 comments on commit 6c5f8b4

Please sign in to comment.