From 0168c425ece4e8e52cffbd302c19bfd52d4a93c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Wed, 30 Sep 2020 23:21:12 +0200 Subject: [PATCH 1/8] Do not try to manually create a wx.PaintEvent Since wxWidgets 3.1.4, manually creating a wxPaintEvent is no longer possible, also see commit 376150788293 ("wxObjectDataPtr, wxGridCell*Ptr, and other changes needed for updated wxWidgets"). --- unittests/test_event.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/unittests/test_event.py b/unittests/test_event.py index d5335aa5..3f343cd2 100644 --- a/unittests/test_event.py +++ b/unittests/test_event.py @@ -116,9 +116,6 @@ class Events(wtc.WidgetTestCase): def test_NotifyEvent_ctor(self): evt = wx.NotifyEvent() - def test_PaintEvent_ctor(self): - evt = wx.PaintEvent() - def test_PaletteChangedEvent_ctor(self): evt = wx.PaletteChangedEvent() From 9baba68cffb077212addda3fab95d550aa304ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Wed, 30 Sep 2020 23:35:43 +0200 Subject: [PATCH 2/8] Remove constructor test for no longer existant AuiPanelButton The helper class was removed in wxWidgets 3.1.4, commit https://github.com/wxWidgets/wxWidgets/commit/5663157674c31ea0 ("Fix link between flags and buttons in wxAuiManager"). --- unittests/test_auiframemanager.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/unittests/test_auiframemanager.py b/unittests/test_auiframemanager.py index 4993e6b4..b059be48 100644 --- a/unittests/test_auiframemanager.py +++ b/unittests/test_auiframemanager.py @@ -98,10 +98,6 @@ class auiframemanager_Tests(wtc.WidgetTestCase): obj = wx.aui.AuiDockUIPart() - def test_auiframemanager10(self): - obj = wx.aui.AuiPaneButton() - - #--------------------------------------------------------------------------- if __name__ == '__main__': From 62cda454f1bdde7fd549c2c37af19555e562b5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Thu, 1 Oct 2020 02:21:33 +0200 Subject: [PATCH 3/8] Do not specify invalid alignment in BoxSizer flags Specyfing a horizontal alignment in a wxHORIZONTAL layed out BoxSizer is pointless, and doing so throws an exception: wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_RIGHT)" failed at ./src/common/sizer.cpp(2133) in DoInsert(): Horizontal alignment flags are ignored in horizontal sizers --- unittests/test_sizer.py | 2 +- wx/lib/agw/fmcustomizedlg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/test_sizer.py b/unittests/test_sizer.py index af432fe5..29d1c60c 100644 --- a/unittests/test_sizer.py +++ b/unittests/test_sizer.py @@ -56,7 +56,7 @@ class sizer_Tests(wtc.WidgetTestCase): def test_sizerFlags(self): bs = wx.BoxSizer() bs.Add(wx.Panel(self.frame), - wx.SizerFlags(2).Border(wx.ALL, 5).Align(wx.ALIGN_RIGHT)) + wx.SizerFlags(2).Border(wx.ALL, 5).Align(wx.ALIGN_TOP)) def test_sizerAddMany(self): bs = wx.BoxSizer() diff --git a/wx/lib/agw/fmcustomizedlg.py b/wx/lib/agw/fmcustomizedlg.py index c4078529..db9ad439 100644 --- a/wx/lib/agw/fmcustomizedlg.py +++ b/wx/lib/agw/fmcustomizedlg.py @@ -219,7 +219,7 @@ class FMCustomizeDlg(wx.Dialog): hsizer = wx.BoxSizer(wx.HORIZONTAL) # add a separator between the book & the buttons area - hsizer.Add(wx.Button(self, wx.ID_OK, _("&Close")), 0, wx.EXPAND | wx.ALIGN_RIGHT) + hsizer.Add(wx.Button(self, wx.ID_OK, _("&Close")), 0, wx.EXPAND) sz.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 3) sz.Add(hsizer, 0, wx.ALIGN_RIGHT | wx.ALL, 2) From 36686a8c75cc6cc0fbdb611ef9613eefcfde061d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 2 Oct 2020 15:18:52 +0200 Subject: [PATCH 4/8] Pass data as bytes in UIActionSimulator::Test The Test parameter no longer is a wxString but a const char*, as the method only handles plain ASCII. --- unittests/test_uiaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/test_uiaction.py b/unittests/test_uiaction.py index 0fa79ca1..f5584e99 100644 --- a/unittests/test_uiaction.py +++ b/unittests/test_uiaction.py @@ -186,7 +186,7 @@ class uiaction_KeyboardTests(wtc.WidgetTestCase): @unittest.skipIf(sys.platform == 'darwin', 'wx.UIActionSimulator.Text needs work...') def test_uiactionKeyboardText(self): uia = wx.UIActionSimulator() - uia.Text("This is a test") + uia.Text(b"This is a test") self.waitFor(WAIT*2) self.assertEqual(self.tc.GetValue(), "This is a test") From 6d59201c006feb6f119bfb45ced94ca08d16ca1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 2 Oct 2020 19:56:42 +0200 Subject: [PATCH 5/8] Remove instatiation test of accidentially exposed values The values are just internal constants and were only exposed by accident, reverted by https://github.com/wxWidgets/wxWidgets/commit/9e5dd5091402a7f4 ("Revert some changes from incorrect merge that discarded formatting, etc.") --- unittests/test_propgridproperty.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/unittests/test_propgridproperty.py b/unittests/test_propgridproperty.py index 4a60a4b5..83f94bde 100644 --- a/unittests/test_propgridproperty.py +++ b/unittests/test_propgridproperty.py @@ -15,12 +15,6 @@ class property_Tests(wtc.WidgetTestCase): d.m_drawnHeight - def test_propgridproperty02(self): - pg.PG_CUSTOM_IMAGE_SPACINGY - pg.PG_CAPRECTXMARGIN - pg.PG_CAPRECTYMARGIN - - def test_propgridproperty03(self): with self.assertRaises(TypeError): # it's an abstract class, so it can't be instantiated From dab475752556e1e0ec56d96511963e598696f205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 2 Oct 2020 20:02:31 +0200 Subject: [PATCH 6/8] Remove tests for removed OS/2 list states, and invalid hittest case These states were OS/2 specific and have been removed: https://github.com/wxWidgets/wxWidgets/commit/01f9accd19755fdc ("Remove wxPM, wxWidgets port to OS/2.") ONITEMRIGHT is only meaningfull for trees, and was removed from the interface: https://github.com/wxWidgets/wxWidgets/commit/6c9b3a825407b362 ("Improved wxListCtrl::HitTest() docs") --- unittests/test_listctrl.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/unittests/test_listctrl.py b/unittests/test_listctrl.py index 25adabb8..c8c2d39a 100644 --- a/unittests/test_listctrl.py +++ b/unittests/test_listctrl.py @@ -124,18 +124,12 @@ class listctrl_Tests(wtc.WidgetTestCase): wx.LIST_STATE_FOCUSED wx.LIST_STATE_SELECTED wx.LIST_STATE_CUT - wx.LIST_STATE_DISABLED - wx.LIST_STATE_FILTERED - wx.LIST_STATE_INUSE - wx.LIST_STATE_PICKED - wx.LIST_STATE_SOURCE wx.LIST_HITTEST_ABOVE wx.LIST_HITTEST_BELOW wx.LIST_HITTEST_NOWHERE wx.LIST_HITTEST_ONITEMICON wx.LIST_HITTEST_ONITEMLABEL - wx.LIST_HITTEST_ONITEMRIGHT wx.LIST_HITTEST_ONITEMSTATEICON wx.LIST_HITTEST_TOLEFT wx.LIST_HITTEST_TORIGHT From 83e1470f255d5f4361ca730c5c6b5acc0935cec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 2 Oct 2020 20:54:31 +0200 Subject: [PATCH 7/8] Remove pagebreak array from HtmlDCRenderer::Render parameters The Render call was changed in https://github.com/wxWidgets/wxWidgets/commit/e01892c669748065 ("Split and simplify wxHtmlDCRenderer::Render()") --- unittests/test_htmlprint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/test_htmlprint.py b/unittests/test_htmlprint.py index 25bc9fef..4c0b40d4 100644 --- a/unittests/test_htmlprint.py +++ b/unittests/test_htmlprint.py @@ -17,7 +17,7 @@ class htmlprint_Tests(wtc.WidgetTestCase): obj.SetSize(*size) obj.SetHtmlText('

Hello World

') - obj.Render(0,0, []) + obj.Render(0,0) def test_htmlprint2(self): From cf30fc3e175153d8f67e1c4ba0e413182b656c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sun, 4 Oct 2020 16:20:27 +0200 Subject: [PATCH 8/8] Remove test for default-constructed wxPGWindowList, use Getters The default constructor has been removed in wxWidgets 3.1.4, commit https://github.com/wxWidgets/wxWidgets/commit/f2f9cbe61960 "(Get rid of unused wxPGWindowList ctor"). Now, at least the primary is required, the secondary is defaulted. The members are no longer public in the interface. --- unittests/test_propgrideditors.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/unittests/test_propgrideditors.py b/unittests/test_propgrideditors.py index 4946a8a3..36be5e64 100644 --- a/unittests/test_propgrideditors.py +++ b/unittests/test_propgrideditors.py @@ -9,12 +9,13 @@ class propgrideditors_Tests(wtc.WidgetTestCase): def test_propgrideditors01(self): - wl = pg.PGWindowList() - assert wl.m_primary is None - assert wl.m_secondary is None - wl = pg.PGWindowList(self.frame) - assert wl.m_primary is self.frame + assert wl.GetPrimary() is self.frame + assert wl.GetSecondary() is None + + wl = pg.PGWindowList(self.frame, None) + assert wl.GetPrimary() is self.frame + assert wl.GetSecondary() is None def test_propgrideditors02(self):