wxPython and unittest  - ConvertToBitmap seg fault

You need to have an wxApp object created before you can create

bitmaps,

(and you probably should for other stuff too.) Change your test suite
so it creates an app befor running the tests.

I added a line of code so the test looked like...

    def testCreateAboutbox(self):
        app = wxPySimpleApp() # <- added this line
        self.VERSION = 'TEST'
        self.BUILD_DATE = '111111'
        dlg = None
        dlg = modules.psm.aboutbox.AboutBox(None,
                                            -1,
                                            "About PGEF",
                                             wxPoint(20,20),
                                             wxSize(500,340))
        dlg.GetVersion().SetLabel(str(self.VERSION))
        dlg.GetBuildDate().SetLabel(str(self.BUILD_DATE))
        dlg.CentreOnParent()
        assert dlg != None, 'Couldnt create AboutBox'

and once again the test runs as it should...

Thnaks Robin.

···

On Tue, 2003-10-14 at 12:44, wxPython-users-digest-help@lists.wxwindows.org wrote: