selftest crashed if qbzr installed without pyqt4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QBzr |
Fix Released
|
High
|
Alexander Belchenko |
Bug Description
vila reported in IRC about qbzr bug when he tries to run selftest with qbzr installed without pyqt4.
[17:39] <vila> bialix: by the way, qbzr still blows out when I try to run selftest with python-2.6 (for which I don't have pyqt4)
[17:39] <bialix> file a bug please
[17:40] <bialix> vila: IIRC I dont try to fix selftest w/o PyQt4 yet
[17:40] <vila> bialix: I did and I thought you fixed pretty quickly, only to discover later that the problem was still there
[17:40] <bialix> vila: this is different problem
[17:41] <bialix> I've fixed bug-url command, but you now talks about selftest
[17:41] <bialix> why you run selftest for qbzr if you don;t have qt?
[17:42] <vila> I run selftest and that includes qbzr because it's installed
[17:43] <vila> the problem is that qbzr *aborts* at load time instead of raising some import error or something that disables it without aborting the current command
vila has provided quick fix, but we have to fix it properly. Quick fix is to catch ImportError in test_suite()
=== modified file '__init__.py'
--- __init__.py 2009-02-13 00:42:16 +0000
+++ __init__.py 2009-02-24 15:46:27 +0000
@@ -104,4 +104,8 @@
def load_tests(
from bzrlib.
- return load_tests(
+ try:
+ suite = load_tests(
+ except ImportError:
+ return basic_tests
+ return suite
Related branches
Changed in qbzr: | |
importance: | Undecided → High |
milestone: | none → 0.9.9 |
status: | New → Confirmed |
I have fix that skips only those test modules where it can't import PyQt4. Unfortunately lazy import cannot be used in test modules.
Vincent, how about this warnings during selftest startup when there is no PyQt4, does it acceptable to you?
C:\work\ Bazaar\ mydev.packs\ bzr.dev> py24 bzr selftest -s bp.qbzr Bazaar/ mydev.packs/ bzr.dev/ bzr Bazaar\ mydev.packs\ bzr.dev\ bzrlib (1.13dev python2.4.4)
testing: C:/work/
C:\work\
QBzr: skip module bzrlib. plugins. qbzr.lib. tests.test_ logmodel because PyQt4 is not installed plugins. qbzr.lib. tests.test_ spellcheck because PyQt4 is not installed plugins. qbzr.lib. tests.test_ util because PyQt4 is not installed
QBzr: skip module bzrlib.
QBzr: skip module bzrlib.
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 13 tests in 0.797s
OK
tests passed