mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user