1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-20 02:39:02 +00:00

[PR #11342/266d9d3f backport][stable-12] batch 2 - update Python idiom to 3.7 using pyupgrade (#11345)

batch 2 - update Python idiom to 3.7 using pyupgrade (#11342)

* batch 2 - update Python idiom to 3.7 using pyupgrade

* Apply suggestions from code review

(cherry picked from commit 266d9d3fb0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-12-30 16:00:22 +01:00 committed by GitHub
parent 213dc22217
commit 303bac630a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 64 additions and 70 deletions

View file

@ -82,7 +82,7 @@ class TestInterfacesFileModule(unittest.TestCase):
with open(testfilepath, "wb") as f:
f.write(string.encode())
else:
with open(testfilepath, "r") as goldenfile:
with open(testfilepath) as goldenfile:
goldenData = json.load(goldenfile)
self.assertEqual(goldenData, ifaces)
@ -96,7 +96,7 @@ class TestInterfacesFileModule(unittest.TestCase):
f.write(string.encode())
f.close()
else:
with open(testfilepath, "r") as goldenfile:
with open(testfilepath) as goldenfile:
goldenstring = goldenfile.read()
goldenfile.close()
self.assertEqual(goldenstring, string)