summaryrefslogtreecommitdiff
path: root/oslo_policy/tests/test_shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_policy/tests/test_shell.py')
-rw-r--r--oslo_policy/tests/test_shell.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/oslo_policy/tests/test_shell.py b/oslo_policy/tests/test_shell.py
index 0eb6aa6..b27347c 100644
--- a/oslo_policy/tests/test_shell.py
+++ b/oslo_policy/tests/test_shell.py
@@ -229,7 +229,7 @@ passed: sampleservice:sample_rule2
self.create_config_file(
"target.json",
jsonutils.dumps(target))
- target_file = open(self.get_config_file_fullname('target.json'), 'r')
- target_from_file = target_file.read()
+ with open(self.get_config_file_fullname('target.json'), 'r') as fh:
+ target_from_file = fh.read()
result = shell.flatten(jsonutils.loads(target_from_file))
self.assertEqual(result, {"target.secret.project_id": "1234"})