Sorry for a late reply - but thanks for a very useful answer. Got one
more question though.
How would you technically moc QFileDialog.exec_ to avoid that the unit
test is halted by the Dialog popping up in its own event loop. Anyway,
this is how I do it:
class Proxy:
def __init__(self):
On 07.03.12 15:42:34, Mads Ipsen wrote:
> OK, I agree, the snippets I provided were not nice, and I apologize
> for that.
>
> But suppose that the constructor in your class starts a thread that
> generates say an icon for a QStandardItem. Then you want to make
> sure that the thread has finished b
OK, I agree, the snippets I provided were not nice, and I apologize for
that.
But suppose that the constructor in your class starts a thread that
generates say an icon for a QStandardItem. Then you want to make sure
that the thread has finished before you test that the icon has been created.
On 07.03.12 09:37:38, Mads Ipsen wrote:
> Hi,
>
> I have a general question about how to unit test PyQt applications
> using the Python unittest moudle. I have attached a few examples. If
> you have time to take a look and comment, it would be great.
>
> The first module, Foo.py, defines a simple
On 07/03/2012 09:43, Luca Beltrame wrote:
In data mercoledì 7 marzo 2012 09:37:38, Mads Ipsen ha scritto:
the Python unittest moudle. I have attached a few examples. If you have
time to take a look and comment, it would be great.
I have a question on FooTest: is having a QApplication instance
Have modified the Bar example, since the thread was never started. Sorry
for posting an incomplete example.
Anyway, now in this case, running the unittest gives:
FQThread: Destroyed while thread is still running
Segmentation fault
On 07/03/2012 09:43, Luca Beltrame wrote:
In data mercoledì 7
On 07/03/2012 09:43, Luca Beltrame wrote:
In data mercoledì 7 marzo 2012 09:37:38, Mads Ipsen ha scritto:
the Python unittest moudle. I have attached a few examples. If you have
time to take a look and comment, it would be great.
I have a question on FooTest: is having a QApplication instance
In data mercoledì 7 marzo 2012 09:37:38, Mads Ipsen ha scritto:
> the Python unittest moudle. I have attached a few examples. If you have
> time to take a look and comment, it would be great.
I have a question on FooTest: is having a QApplication instance enough in
unittest to ensure emission of
Hi,
I have a general question about how to unit test PyQt applications using
the Python unittest moudle. I have attached a few examples. If you have
time to take a look and comment, it would be great.
The first module, Foo.py, defines a simple widget called 'Widget' which
is tested in FooTes