Moved closing of fd1 to the inner try block in the test_do_write_err function.
This is a follow up change to the previous commit to fs_utils unit test case patch. Change-Id: I677683677071efc6176ad2145d1806bc7e658c9e Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5116 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
This commit is contained in:
parent
dc870d2620
commit
3c0cdd74ec
@ -87,7 +87,7 @@ class TestFsUtils(unittest.TestCase):
|
||||
except OSError:
|
||||
pass
|
||||
else:
|
||||
self.fail("IOError expected")
|
||||
self.fail("OSError expected")
|
||||
|
||||
def test_do_write(self):
|
||||
fd, tmpfile = mkstemp()
|
||||
@ -108,10 +108,10 @@ class TestFsUtils(unittest.TestCase):
|
||||
pass
|
||||
else:
|
||||
self.fail("OSError expected")
|
||||
finally:
|
||||
os.close(fd1)
|
||||
except OSError as ose:
|
||||
self.fail("Open failed with %s" %ose.strerror)
|
||||
else:
|
||||
os.close(fd1)
|
||||
finally:
|
||||
os.close(fd)
|
||||
os.remove(tmpfile)
|
||||
|
Loading…
x
Reference in New Issue
Block a user