Skip to content

Commit

Permalink
Fix test resource file loading to use context manager for safer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jonulak committed Oct 24, 2024
1 parent fd3a9d1 commit c472546
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@


def load_resource_file(file_name):
file = open(file_name, "rb")
data = io.BytesIO(file.read())
file.close()
with open(file_name, "rb") as file:
data = io.BytesIO(file.read())
return data


Expand Down

0 comments on commit c472546

Please sign in to comment.