[py-dev] xdist sending info between master and slave - support for client code

meme dough memedough at gmail.com
Thu Apr 22 15:50:57 CEST 2010


Hi,

> The test looks fine.  Looking at your patch and at things some more i
> wonder if it isn't eventually better to introduce a new hook - even
> if it requires a new py.test release.  Something like:
>
>    # runs only on the master side
>    def pytest_xdist_configure_node(node):
>        node.slaveinput[NAME] = value
>
>    # any hook or test can do the following manipulation
>        if hasattr(config, 'slavedata'): # means we are running slave side
>            config.slaveinput[NAME]      # access data sent from the master
>            config.slaveoutput['result'] = 42  # set slave output
>
>    # runs only on the master side
>    def pytest_xdist_nodedown(node, slaveoutput):
>        node.slaveoutput['result'] # access result from slave
>
> I think both internal implementation and usage becomes simpler.
> What do you think?

It looks good.  The hook names can be made consistent as well as
consistent args.

:)



More information about the Pytest-dev mailing list