MCPcopy
hub / github.com/pytest-dev/pytest-xdist / setup

Method setup

src/xdist/looponfail.py:87–105  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85 return execnet.makegateway("execmodel=main_thread_only//popen")
86
87 def setup(self) -> None:
88 if hasattr(self, "gateway"):
89 raise ValueError("already have gateway %r" % self.gateway)
90 self.trace("setting up worker session")
91 self.gateway = self.initgateway()
92 self.channel = channel = self.gateway.remote_exec(
93 init_worker_session,
94 args=self.config.args,
95 option_dict=vars(self.config.option),
96 )
97 remote_outchannel: execnet.Channel = channel.receive()
98
99 out = TerminalWriter()
100
101 def write(s: str) -> None:
102 out._file.write(s)
103 out._file.flush()
104
105 remote_outchannel.setcallback(write)
106
107 def ensure_teardown(self) -> None:
108 if hasattr(self, "channel"):

Callers 4

loop_onceMethod · 0.95
test_nofailuresMethod · 0.95

Calls 2

traceMethod · 0.95
initgatewayMethod · 0.95

Tested by 3

test_nofailuresMethod · 0.76