[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2016-09-11 Thread Robert Collins
Robert Collins added the comment: I could imagine doing some complex things to let you get at the AttributeError in this case but *not* when a different descriptor was added to type(a_mock), but I think it would confusing overall. This might be worth a doc tweak to cover it? -- stage:

[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2016-09-11 Thread Steve Kowalik
Steve Kowalik added the comment: This is in fact, working entirely as expected. If we define a property that raises an AttributeError, then __getattr__() will be called, since the descriptor protocol says that an attribute error is a missing descriptor. >>> class Foo(object): ... def __geta

[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2016-09-11 Thread Robert Collins
Robert Collins added the comment: We're poking at this at the kiwipycon sprints -- nosy: +rbcollins ___ Python tracker ___ ___ Python-

[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2014-04-16 Thread Eric Snow
Eric Snow added the comment: Perhaps related to #1615? -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2014-04-16 Thread Michael Foord
New submission from Michael Foord: What steps will reproduce the problem? >>> import mock >>> a_mock = mock.MagicMock() >>> no_attribute = mock.PropertyMock(side_effect=AttributeError) >>> type(a_mock).property = no_attribute What is the expected output? What do you see instead? I would expe