Pubsub 3.3 unittests in Phoenix

20 views
Skip to first unread message

Werner

unread,
Feb 12, 2014, 4:46:18 AM2/12/14
to PyPubSub
Hi,

I am trying to update the unittests in Phoenix to be compatible with 3.3.

We had this:
verifyNonSendable(rootTopic, (rootName,), topicMgr.getRootTopic())

Changed it to this:
verifyNonSendable(rootTopic, (rootName,), topicMgr.getTopicAllTopics())

Is this correct, if yes maybe add a note to the change log if not what
is the correct replacement?

At this point I have one failing test which is:

def test10_DefnProvider(self):
#
# Test the addition and clearing of definition providers
#
topicMgr = self.pub.getDefaultTopicMgr()

class DefnProvider:
pass
dp1 = DefnProvider()
dp2 = DefnProvider()
assert 1 == topicMgr.addDefnProvider(dp1)
assert 1 == topicMgr.addDefnProvider(dp1)
assert 2 == topicMgr.addDefnProvider(dp2)
assert 2 == topicMgr.addDefnProvider(dp2)
assert 2 == topicMgr.addDefnProvider(dp1)
topicMgr.clearDefnProviders()
assert 0 == topicMgr.getNumDefnProviders()
assert 1 == topicMgr.addDefnProvider(dp1)
topicMgr.clearDefnProviders()

and it gives me the following exception, any idea?

case.py (c:\Python27\Lib\unittest): 331
testMethod()
test_lib_pubsub_topicmgr.py (H:\devProjectsT\Phoenix\unittests): 200
assert 1 == topicMgr.addDefnProvider(dp1)
topicmgr.py
(c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\lib\pubsub\core): 116
provider = TopicDefnProvider(source, format or
TOPIC_TREE_FROM_MODULE)
topicdefnprovider.py
(c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\lib\pubsub\core): 340
provider = providerClassObj(source, **providerKwargs)
topicdefnprovider.py
(c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\lib\pubsub\core): 244
module = imp2.load_module(moduleName, searchPath)
imp2.py
(c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\lib\pubsub\core): 54
fp, pathname, description = imp.find_module(moduleName, searchPath)
Exception: TypeError: must be string, not instance

Values are:
moduleName
<test_lib_pubsub_topicmgr.DefnProvider instance at 0x03D929B8>
searchPath

Werner

unread,
Feb 12, 2014, 5:23:57 AM2/12/14
to PyPubSub
Hi,

Oops, there are a few more issues in other pubsub tests.

Can not find these in the change log, what should they be replaced with?

self.pub.getListenerID
self.pub.ListenerSpecIncomplete

Werner

Werner

unread,
Feb 13, 2014, 6:02:20 AM2/13/14
to PyPubSub
Hi Oliver,
I resolved them all and did a PR for Robin.

If you have a moment could you review it to make sure that I didn't mess
anything up?

https://github.com/RobinD42/Phoenix/pull/68/files?w=1

BTW, the '?w=1' at the end removes the whitespace changes which slipped in.

Werner

oliver

unread,
Feb 13, 2014, 8:22:58 AM2/13/14
to PyPubSub
Hi Werner, I will take a look, but glad you find the fixes necessary. I did cleanup the API at the pub level to only leave things that would be useful, removing everything that was "expert" level. I didn't realize you guys had your own set of unit tests, this is a lot of duplication of those that pubsub already uses, you sure that's necessary? 
Oliver




Werner

--
You received this message because you are subscribed to the Google Groups "pypubsub" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pypubsub+unsubscribe@googlegroups.com.
To post to this group, send email to pypu...@googlegroups.com.
Visit this group at http://groups.google.com/group/pypubsub.
For more options, visit https://groups.google.com/groups/opt_out.



--
Oliver
Contributor to Open Source: PyPubSub, Lua-iCxx, iof
Contributor to StackOverflow

Werner

unread,
Feb 13, 2014, 9:07:20 AM2/13/14
to pypu...@googlegroups.com
Hi Oliver,

On 13/02/2014 14:22, oliver wrote:
> Hi Werner, I will take a look, but glad you find the fixes necessary.
> I did cleanup the API at the pub level to only leave things that would
> be useful, removing everything that was "expert" level.
Which I think is a good idea.
> I didn't realize you guys had your own set of unit tests, this is a
> lot of duplication of those that pubsub already uses, you sure that's
> necessary?
It would be nice to have just one set. IIRC when I did them for Phoenix
last year I don't think one could have dropped the ones you had just in,
but then I am no expert on this. Maybe take this up with Robin and see
what can be done to have just one set which works for both your testing
setup and the one Robin uses.

Maybe before you spend time reviewing the PR bring it up with Robin on
the wxpyton-dev list, maybe in the thread about the pubsub tests "Re:
[wxPython-dev] Pubsub unittests"

Werner

Werner

unread,
Feb 13, 2014, 9:41:13 AM2/13/14
to pypu...@googlegroups.com
Hi Oliver,

On 13/02/2014 15:07, Werner wrote:

...
> Maybe before you spend time reviewing the PR bring it up with Robin on
> the wxpyton-dev list, maybe in the thread about the pubsub tests "Re:
> [wxPython-dev] Pubsub unittests"
FYI, Robin currently uses unittest as his reason was not to have
additional dependencies, see the short discussion at the end of this
thread "Re: [wxPython-dev] Phoenix - floatcanvas doc and tests", in it
Chris and Robin talked about pytest.

Werner

Reply all
Reply to author
Forward
0 new messages