test_treewidget.TestTreeModel.test_model_working_tree fatal error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QBzr |
Fix Released
|
High
|
Gary van der Merwe |
Bug Description
When I run selftest on Windows I'm get error dialog window with the following text:
-------
Microsoft Visual C++ Runtime Library
-------
Runtime Error!
Program: C:\Program Files\Bazaar\
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
-------
ОК
-------
Log in the console (for bzr selftest -s bp.qbzr -v):
bzrlib.
bzrlib.
bzrlib.
I'm disable this tests for now, because it totaly break test suite for me.
Related branches
- Alexander Belchenko: Pending requested
-
Diff: 25 lines (+2/-2)1 file modifiedlib/treewidget.py (+2/-2)
Changed in qbzr: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Gary van der Merwe (garyvdm) |
Changed in qbzr: | |
milestone: | none → 0.16 |
status: | Confirmed → Fix Released |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Belchenko wrote: ------- ------- ------ ------- ------- ------ bzr.exe ------- ------- ------ ------- ------- ------ plugins. qbzr.lib. tests.test_ treewidget. TestModelItemDa ta.test_ sort_key_ one_dir OK 14ms plugins. qbzr.lib. tests.test_ treewidget. TestModelItemDa ta.test_ sort_key_ sub_dirs OK 0ms
> Public bug reported:
>
> When I run selftest on Windows I'm get error dialog window with the
> following text:
>
> -------
> Microsoft Visual C++ Runtime Library
> -------
> Runtime Error!
>
> Program: C:\Program Files\Bazaar\
>
>
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
>
>
> -------
> ОК
> -------
>
>
> Log in the console (for bzr selftest -s bp.qbzr -v):
>
> bzrlib.
> bzrlib.
...
QPixmap: Must construct a QApplication before a QPaintDevice
I think this is the core of the problem. QApplication is where Qt does
all of its memory management, etc. There must be a single QApplication
running when you want to do things with Qt objects.
In my qt based test suites, I created a TestCase like:
import unittest
class TestCaseWithQt( unittest. TestCase) :
the_app = None
def setUp(self): TestCaseWithQt, self).setUp() the_app is None: ithQt.the_ app = QtCore. QApplication( ) # pass args?
super(
if TestCaseWithQt.
TestCaseW
Basically, you just ensure that a singleton QApplication is running. I
would think you could do something similar, or possibly change it around
a bit and do that in 'load_tests'.
def load_tests(...): QApplication( )
global the_app
if the_app is None:
the_app = QtCore.
# ensure an App before running the tests.
This isn't quite as nice, as it will still build the QApplication even
if someone later filters out all qt tests ('bzr selftest -x qbzr'). But
it is probably still a reasonable way to do it.
John enigmail. mozdev. org/
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkr 2BR0ACgkQJdeBCY SNAAPD7gCfbYNkj spWuhZ2lTPl2PNR fX3b odzLWT9QGcNajX4 wWP+lHxn
Nk4AoMm1+
=NEgb
-----END PGP SIGNATURE-----