update docstr and do not swallow other errno

This commit is contained in:
Yuming Zhu 2019-01-16 14:36:47 +08:00 committed by Tomas Kopecek
parent 589eb2dc9c
commit 2956319c39
2 changed files with 4 additions and 10 deletions

View file

@ -44,12 +44,6 @@ class TestEnsureDir(unittest.TestCase):
ensuredir('path')
mock_mkdir.assert_called_once_with('path')
mock_mkdir.reset_mock()
mock_mkdir.side_effect = OSError(errno.EEXIST + 1, 'ignored error')
mock_isdir.return_value = False
ensuredir('path')
mock_mkdir.assert_called_once_with('path')
@mock.patch('os.mkdir')
@mock.patch('os.path.exists')
@mock.patch('os.path.isdir')