mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-07-21 12:41:10 +02:00
Add missing context manager methods for wx.LogNull
This commit is contained in:
@@ -116,11 +116,13 @@ def run():
|
||||
c.addPrivateCopyCtor()
|
||||
c.addPrivateAssignOp()
|
||||
|
||||
|
||||
|
||||
c = module.find('wxLogFormatter')
|
||||
c.find('FormatTime').ignore(False)
|
||||
|
||||
c = module.find('wxLogNull')
|
||||
c.addPyMethod('__enter__', '(self)', 'return self')
|
||||
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'return False')
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
|
@@ -23,6 +23,12 @@ class log_Tests(wtc.WidgetTestCase):
|
||||
wx.LogMessage("This is a test")
|
||||
self.assertTrue(log.messageLogged)
|
||||
|
||||
|
||||
def test_lognull_is_context_mgr(self):
|
||||
with wx.LogNull():
|
||||
pass
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user