Skip to content

Commit

Permalink
[tests/s3] fix unclosed temporary files (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier authored Sep 2, 2023
1 parent e5ac756 commit 8e6ebf5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_s3boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,10 @@ def test_storage_open_read_string(self):
Test opening a file in "r" mode (ie reading as string, not bytes)
"""
name = 'test_open_read_string.txt'
content_str = self.storage.open(name, "r").read()
file = self.storage.open(name, "r")
content_str = file.read()
self.assertEqual(content_str, "")
file.close()

def test_storage_open_write(self):
"""
Expand Down Expand Up @@ -348,6 +350,7 @@ def test_write_bytearray(self):
obj.key = name
bytes_written = file.write(content)
self.assertEqual(len(content), bytes_written)
file.close()

def test_storage_open_no_write(self):
"""
Expand Down

0 comments on commit 8e6ebf5

Please sign in to comment.