From 76444003fe41835393aed1a3445d9ac96d6b8dfe Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Thu, 8 Sep 2016 20:25:10 -0400 Subject: [PATCH] Fix pubsub test when run boxed --- unittests/test_lib_pubsub_api3.py | 1 + unittests/test_lib_pubsub_except.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/unittests/test_lib_pubsub_api3.py b/unittests/test_lib_pubsub_api3.py index 843bf561..d8483b68 100644 --- a/unittests/test_lib_pubsub_api3.py +++ b/unittests/test_lib_pubsub_api3.py @@ -234,6 +234,7 @@ class lib_pubsub_Except(wtc.PubsubTestCase): def testTopicUnspecifiedError(self): #pub.TopicDefnError, pub.setTopicUnspecifiedFatal + self.pub.getDefaultTopicMgr().getOrCreateTopic('a.b') self.assertRaises(self.pub.TopicDefnError, self.pub.setTopicUnspecifiedFatal) self.pub.setTopicUnspecifiedFatal(checkExisting=False) def fn(): diff --git a/unittests/test_lib_pubsub_except.py b/unittests/test_lib_pubsub_except.py index df482758..80ae5363 100644 --- a/unittests/test_lib_pubsub_except.py +++ b/unittests/test_lib_pubsub_except.py @@ -69,6 +69,9 @@ class lib_pubsub_Except(wtc.PubsubTestCase): assert msg.endswith("name 'RuntimeError2' is not defined\n") from wx.lib.pubsub.utils.exchandling import ExcPublisher + if not self.pub.getDefaultTopicMgr().hasTopicDefinition(ExcPublisher.topicUncaughtExc): + excPublisher = ExcPublisher(self.pub.getDefaultTopicMgr() ) + self.pub.setListenerExcHandler(excPublisher) topic = self.pub.getDefaultTopicMgr().getTopic(ExcPublisher.topicUncaughtExc) assert not topic.hasListeners() handler = UncaughtExcListener()