We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84ac521 commit b806b92Copy full SHA for b806b92
gcloud/test__helpers.py
@@ -224,12 +224,12 @@ def test_read_from_cli_info(self):
224
225
def test_gae_without_expanduser(self):
226
import sys
227
- import pwd
228
- del pwd
229
- sys.modules['pwd'] = None # Blocks pwd from being imported.
230
- project_id = self.callFUT('test-project-id')
231
- self.assertEqual(None, project_id)
232
- del sys.modules['pwd'] # Unblocks importing of pwd.
+ try:
+ sys.modules['pwd'] = None # Blocks pwd from being imported.
+ project_id = self.callFUT('test-project-id')
+ self.assertEqual(None, project_id)
+ finally:
+ del sys.modules['pwd'] # Unblocks importing of pwd.
233
234
def test_info_value_not_present(self):
235
project_id = self.callFUT()
0 commit comments