diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-01-19 14:28:59 -0800 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2016-02-08 14:48:15 -0800 |
commit | cecbe5c1f52a57cbc93b292211792120be353408 (patch) | |
tree | ac91544ab3391aad55907b18a208ecfdd35d3f99 /unittests | |
parent | 061cf4a694eb97b71b6599c84081789f478a32bc (diff) |
unittests/options_tests.py: fix mocking for python 3.x
By default the builtins don't appear in the python 3 namespace, and
create=True must be set to make this work.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/options_tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/unittests/options_tests.py b/unittests/options_tests.py index 3d4761011..c11f64270 100644 --- a/unittests/options_tests.py +++ b/unittests/options_tests.py @@ -132,7 +132,8 @@ class TestReListDescriptor(object): """options._ReListDescriptor.__get__: Returns new _ReList if it doesn't exists""" nt.eq_(self.test.notexists, self.test.test_notexists) # pylint: disable=no-member - @mock.patch('framework.options.setattr', mock.Mock(side_effect=Exception)) + @mock.patch('framework.options.setattr', mock.Mock(side_effect=Exception), + create=True) @nt.raises(AttributeError) def test_get_not_exists_fail(self): """options._ReListDescriptor.__get__: Raises AttributError if name doesn't exist and cant be created""" |