[PyQt] Next PyQt and SIP Releases

Darren Dale dsdale24 at gmail.com
Wed Jan 12 22:05:42 GMT 2011


On Thu, Oct 14, 2010 at 8:05 AM, Darren Dale <dsdale24 at gmail.com> wrote:
> On Wed, Oct 13, 2010 at 3:13 PM, Phil Thompson
> <phil at riverbankcomputing.com> wrote:
>> On Wed, 13 Oct 2010 11:50:21 -0400, Darren Dale <dsdale24 at gmail.com>
>> wrote:
>>> On Tue, Oct 12, 2010 at 8:12 AM, Phil Thompson
>>> <phil at riverbankcomputing.com> wrote:
>>>> The current PyQt and SIP snapshots can be considered release
>> candidates.
>>>> Now is a good time to check them against your favorite applications.
>>>
>>> I just installed qt-4.7 on snow leopard, using macports (using a
>>> custom portfile with very minor changes, see
>>> http://trac.macports.org/ticket/26646). I installed the most recent
>>> sip and pyqt4 snapshots for python-2.6 and python-2.7, and then the
>>> dip snapshot. When I run the dip testsuite with either python version,
>>> it stalls and shows a dialog with a spinbox containing "10" and cancel
>>> and ok buttons. I have to give focus to this dialog box, at which
>>> point it closes, and then many more widgets are opened and closed in
>>> rapid succession. I don't recall the widgets rendering before now.
>>
>> Changes to the automate module are the cause of that.
>>
>>> Here is the resulting test report:
>>>
>>>
>> ..........................................................................................................................................................................................................................................F.......F....
>>> ======================================================================
>>> FAIL: test_list (tests.dip_ui.test_mapping.TestMapping)
>>> Test list attributes of a mapping.
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>>   File
>>>
>> "/Users/darren/Downloads/dip-py2-gpl-0.3-snapshot-4deec720d5c2/test/tests/dip_ui/test_mapping.py",
>>> line 81, in test_list
>>>     self.assertEqual(model['attr'], ['first', '2nd'])
>>> AssertionError: Lists differ: ['first', 'second'] != ['first', '2nd']
>>>
>>> First differing element 1:
>>> second
>>> 2nd
>>>
>>> - ['first', 'second']
>>> ?            ^^^^
>>>
>>> + ['first', '2nd']
>>> ?            ^
>>>
>>>
>>> ======================================================================
>>> FAIL: test_List (tests.dip_ui.test_model.TestModel)
>>> Test List attributes of a model.
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>>   File
>>>
>> "/Users/darren/Downloads/dip-py2-gpl-0.3-snapshot-4deec720d5c2/test/tests/dip_ui/test_model.py",
>>> line 215, in test_List
>>>     self.assertEqual(model.attr, ['first', '2nd'])
>>> AssertionError: ['first', 'second'] != ['first', '2nd']
>>>
>>> ----------------------------------------------------------------------
>>> Ran 247 tests in 111.221s
>>>
>>> FAILED (failures=2)
>>>
>>>
>>>
>>> It looks like the dialog issue showed up in the fifth test before the
>>> first failure. Is there a way to print a more verbose report, so in
>>> the future I can do a better job identifying which tests contain
>>> unreported issues?
>>
>> What you've included in the above is fine.
>>
>> I usually remember to run the tests before pushing to the website so, if
>> there is still a failure, it would appear to be platform specific.
>
> I just tested the latest snapshots with python2.6 on Kubuntu Maverick.
> It is still possible to run the test suite without unittest2 installed
> for py26, it yields a long list of attribute errors rather than
> raising an import error during initialization. After installing
> unittest2, the test suite ran without errors or failures. Also, the
> test suite ran to completion without requiring any of the dialogs
> receive focus. So it appears you were right, the issues I reported
> look to be specific to OS X.

I tried looking into this a little further, testing on OS X and
windows 7, with python-3.1, Qt-4.7.1, and PyQt-4.8.2 on Windows or
PyQt-4.8.1 on Mac. I discovered that the
doc/examples/automate/automate_views.py example raises an error:

Traceback (most recent call last):
  File "/Users/darren/.local/lib/python3.1/site-packages/dip/automate/robot.py",
line 63, in _play_commands
    command()
  File "/Users/darren/.local/lib/python3.1/site-packages/dip/automate/robot_command.py",
line 91, in __call__
    raise AutomationError(self.ui, self.command, "unsupported command")
dip.automate.exceptions.AutomationError: dip.dialog:name 'enter'
command: unsupported command

On OS X I have to click on it to give it focus, at which point it
produces the above error. I put some debug statements in
robot_command.py:

        # Get the simulator methods from the items.
        print(items)
        for itm in items:
            print(1, itm, self.command)
            print(dir(itm))
            simulate = getattr(itm, 'simulate_' + self.command, None)
            print(2, simulate)
            if simulate is not None:
                print(3)
                # Execute the command.
                simulate(self.delay, *self.command_args)
                print(4)

The result of which is:

[<dip.ui.toolkits.qt.qlineedit_editor.QLineEditEditorIAutomatedEditorAdapter
object at 0x104758350>]
1 <dip.ui.toolkits.qt.qlineedit_editor.QLineEditEditorIAutomatedEditorAdapter
object at 0x104758350> enter
['__class__', '__delattr__', '__dict__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__',
'__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
'__sizeof__', '__str__', '__subclasshook__', '__weakref__',
'_adaptee', '_dip_interfaces', '_dip_type_cache', '_id', '_indexing',
'adaptee', 'id', 'indexing', 'simulate_set']
2 None

It looks like the framework is expecting a "simulate_enter" command
that has not been defined. Also, I can reproduce the test failures I
reported previously in this thread on both OS X and Windows 7. I
wonder if those may be related to this simulate_enter issue?

Darren


More information about the PyQt mailing list