mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
python: Close opened files.
Fixes various instances of ‘ResourceWarning: unclosed file’ with python -Wd. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
bb2db31f29
commit
31d0141a30
@@ -4657,8 +4657,7 @@ class TestZulipLDAPUserPopulator(ZulipLDAPTestCase):
|
||||
@use_s3_backend
|
||||
def test_update_user_avatar_for_s3(self) -> None:
|
||||
bucket = create_s3_buckets(settings.S3_AVATAR_BUCKET)[0]
|
||||
test_image_file = get_test_image_file('img.png').name
|
||||
with open(test_image_file, 'rb') as f:
|
||||
with get_test_image_file('img.png') as f:
|
||||
test_image_data = f.read()
|
||||
self.change_ldap_user_attr('hamlet', 'jpegPhoto', test_image_data)
|
||||
with self.settings(AUTH_LDAP_USER_ATTR_MAP={'full_name': 'cn',
|
||||
|
||||
Reference in New Issue
Block a user