We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e382d1f commit 234bb6aCopy full SHA for 234bb6a
tests/src/OneLogin/saml2_tests/response_test.py
@@ -24,16 +24,14 @@ class OneLogin_Saml2_Response_Test(unittest.TestCase):
24
def loadSettingsJSON(self, name='settings1.json'):
25
filename = join(self.settings_path, name)
26
if exists(filename):
27
- stream = open(filename, 'r')
28
- settings = json.load(stream)
29
- stream.close()
30
- return settings
+ with open(filename, 'r') as stream:
+ settings = json.load(stream)
+ return settings
31
32
def file_contents(self, filename):
33
- f = open(filename, 'r')
34
- content = f.read()
35
- f.close()
36
- return content
+ with open(filename, 'r') as f:
+ content = f.read()
+ return content
37
38
def get_request_data(self):
39
return {
0 commit comments