On Sun, Jun 14, 2009 at 3:39 PM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sun, 14 Jun 2009 13:09:42 +0200, Arve Knudsen <<a href="mailto:arve.knudsen@gmail.com">arve.knudsen@gmail.com</a>><br>
wrote:<br>
<div><div></div><div class="h5">> Seems like I'm on a roll right now .. I have a case which crashes PyQt<br>
4.5<br>
> under debug-built Python 2.6 on Ubuntu 9.04 x86-64. The attached script<br>
> contains the case, and backtrace.txt gdb's backtrace output.<br>
><br>
> The case is extracted from a unit test of mine, and I've simply pasted<br>
code<br>
> from a mock module which it depends on, so there's a lot of cruft in the<br>
> file. What matters is the class "Test", and apparently what triggers the<br>
> crash is its assignment of the variable "_qbase".<br>
><br>
> It is possible that my QMock class confuses PyQt in some way, but I guess<br>
> it<br>
> shouldn't crash :)<br>
<br>
</div></div>It's not crashing, it's an assertion failure.<br>
<br>
It's checking that an attribute with a particular special name is a list<br>
and failing if not. In your test it is a MockCallable instance instead.<br>
<br>
I could remove the assertion and just silently ignore anything that is an<br>
unexpected type - but I'm not sure if that breaks your mock object.</blockquote><div><br>OK, thanks for pointing this out. I could try to modify my Mock class to recognize and ignore special attributes like this.<br>
<br>Thanks!<br>Arve<br></div></div>