<div dir="ltr">I would just use something like redis for that, seriously<div>Don't overcomplicate things in pytest-xdist</div><div>As a side note, if you need the communication between the tests, then you're probably doing something wrong, as it's the rule of thumb - tests cannot share state with other tests</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 September 2014 18:32, Ayelet Regev <span dir="ltr"><<a href="mailto:ayelet@fabrixsystems.com" target="_blank">ayelet@fabrixsystems.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    I'm creating a time-line based on pytest.<br>
    im using xdist with multiple slaves (in the amount of the tests).
    Each test is started by time and dependency. which mean some of the
    gateways will be waiting for others to be "Done".<br>
    <br>
    for that, io need some data sharing between them all, and cannot use
    "slaveoutput".<br>
    <br>
    i created my own dict object using file handler, and i want to
    create instance once on master and share it will all slaves.<br>
    <br>
    but i cannot pass object to "slaveinput"<br>
    <br>
    Do you have any advice?<br>
    <br>
    <br>
    <b><br>
    </b><b>def pytest_configure(config):</b><br>
    <br>
        config.global_time_line_json = config.getoption("timeline",None)<br>
        unicode_to_ascii(config.global_time_line_json)<br>
        if config.global_time_line_json is None:<br>
            raise Exception("no timeline data was provided to command")<br>
        config.properties = config.getoption("properties")<br>
        unicode_to_ascii(config.properties)<br>
        logfile = config.properties.get("logfile",None)<br>
        if logfile is None:<br>
            raise Exception("no logfile path was provided to command
    under properties")<br>
        config.flow_dir = config.properties.get("flow_dir",None)<br>
        logfile_basename = os.path.basename(logfile)<br>
        _logger = Logger(config.flow_dir,logfile_basename)<br>
        config.logger = _logger.logger()<br>
        config.active_dir = "%s/%s" % (config.flow_dir,ACTIVE_DIR)<br>
        <b>if not hasattr(config,"slaveinput"):</b><b><br>
    </b><b>        config.logger.info2("Master")</b><b><br>
    </b><b>        config.global_data = PersistentDict('%s/%s' %
      (config.active_dir,FLOW_JSON), 'c', format='json')</b><br>
    <br>
    <b>def pytest_configure_node(node):</b><br>
        # runs only on Master<br>
        node.config.logger.info2("on Master sending data to Slave")<br>
       <b> node.slaveinput["global_data"] = node.config.global_data</b><span class="HOEnZb"><font color="#888888"><br>
    <br>
    <pre cols="72">-- 
Best Regards,

Ayelet Regev Dabah
Email: <a href="mailto:ayelet@fabrixsystems.com" target="_blank">ayelet@fabrixsystems.com</a></pre>
  </font></span></div>

<br>_______________________________________________<br>
Pytest-dev mailing list<br>
<a href="mailto:Pytest-dev@python.org">Pytest-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pytest-dev" target="_blank">https://mail.python.org/mailman/listinfo/pytest-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Anatoly Bubenkov<br></div>
</div>