Fix test which fails on some python 2.6 installs.
This commit is contained in:
parent
65815c3875
commit
57a5490c41
1 changed files with 3 additions and 1 deletions
|
@ -21,6 +21,7 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
try:
|
||||
import builtins
|
||||
|
@ -100,7 +101,8 @@ class TestSetModeIfDifferent(TestSetModeIfDifferentBase):
|
|||
with patch('os.lchmod', return_value=None, create=True) as m_os:
|
||||
m.side_effect = [self.mock_stat1, self.mock_stat2, self.mock_stat2]
|
||||
self.am._symbolic_mode_to_octal = MagicMock(side_effect=Exception)
|
||||
self.assertRaises(SystemExit, self.am.set_mode_if_different, '/path/to/file', 'o+w,g+w,a-r', False)
|
||||
with pytest.raises(SystemExit):
|
||||
self.am.set_mode_if_different('/path/to/file', 'o+w,g+w,a-r', False)
|
||||
|
||||
original_hasattr = hasattr
|
||||
def _hasattr(obj, name):
|
||||
|
|
Loading…
Reference in a new issue