Skip to content

Commit 115a41c

Browse files
committed
Finish removal of "slave" terminology
See issue #234. It's time.
1 parent 607ddf5 commit 115a41c

File tree

6 files changed

+13
-31
lines changed

6 files changed

+13
-31
lines changed

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
pytest-xdist 1.33.0 (future)
2+
================================
3+
4+
Deprecations and Removals
5+
-------------------------
6+
7+
- `#234 <https://github.com/pytest-dev/pytest-xdist/issues/234>`_: drop backward-compatibility
8+
"slave" aliases related to worker nodes. We deliberately moved away from this terminology
9+
years ago, and it seems like the right time to finish the deprecation and removal process.
10+
11+
112
pytest-xdist 1.32.0 (2020-05-03)
213
================================
314

src/xdist/dsession.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ def worker_workerready(self, node, workerinfo):
150150
node.workerinfo["id"] = node.gateway.id
151151
node.workerinfo["spec"] = node.gateway.spec
152152

153-
# TODO: (#234 task) needs this for pytest. Remove when refactor in pytest repo
154-
node.slaveinfo = node.workerinfo
155-
156153
self.config.hook.pytest_testnodeready(node=node)
157154
if self.shuttingdown:
158155
node.shutdown()

src/xdist/plugin.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ def pytest_addoption(parser):
6262
)
6363
group.addoption(
6464
"--max-worker-restart",
65-
"--max-slave-restart",
6665
action="store",
6766
default=None,
6867
dest="maxworkerrestart",
6968
help="maximum number of workers that can be restarted "
70-
"when crashed (set to zero to disable this feature)\n"
71-
"'--max-slave-restart' option is deprecated and will be removed in "
72-
"a future release",
69+
"when crashed (set to zero to disable this feature)",
7370
)
7471
group.addoption(
7572
"--dist",

src/xdist/remote.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,5 @@ def setup_config(config, basetemp):
254254
config._parser.prog = os.path.basename(workerinput["mainargv"][0])
255255
config.workerinput = workerinput
256256
config.workeroutput = {}
257-
# TODO: deprecated name, backward compatibility only. Remove it in future
258-
config.slaveinput = config.workerinput
259-
config.slaveoutput = config.workeroutput
260257
interactor = WorkerInteractor(config, channel)
261258
config.hook.pytest_cmdline_main(config=config)

src/xdist/workermanage.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,9 @@ def __init__(self, nodemanager, gateway, config, putevent):
224224
self.workerinput = {
225225
"workerid": gateway.id,
226226
"workercount": len(nodemanager.specs),
227-
"slaveid": gateway.id,
228-
"slavecount": len(nodemanager.specs),
229227
"testrunuid": nodemanager.testrunuid,
230228
"mainargv": sys.argv,
231229
}
232-
# TODO: deprecated name, backward compatibility only. Remove it in future
233-
self.slaveinput = self.workerinput
234230
self._down = False
235231
self._shutdown_sent = False
236232
self.log = py.log.Producer("workerctl-%s" % gateway.id)
@@ -329,7 +325,7 @@ def process_from_remote(self, eventcall): # noqa too complex
329325
self.notify_inproc(eventname, node=self, **kwargs)
330326
elif eventname == "workerfinished":
331327
self._down = True
332-
self.workeroutput = self.slaveoutput = kwargs["workeroutput"]
328+
self.workeroutput = kwargs["workeroutput"]
333329
self.notify_inproc("workerfinished", node=self)
334330
elif eventname in ("logstart", "logfinish"):
335331
self.notify_inproc(eventname, node=self, **kwargs)

testing/acceptance_test.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,6 @@ def pytest_load_initial_conftests(early_config):
246246
result.stderr.fnmatch_lines(["--foobar=123 active! *"])
247247
assert dest.join(subdir.basename).check(dir=1)
248248

249-
def test_backward_compatibility_worker_terminology(self, testdir):
250-
"""Ensure that we still support "config.slaveinput" for backward compatibility (#234).
251-
252-
Keep in mind that removing this compatibility will break a ton of plugins and user code.
253-
"""
254-
testdir.makepyfile(
255-
"""
256-
def test(pytestconfig):
257-
assert hasattr(pytestconfig, 'slaveinput')
258-
assert hasattr(pytestconfig, 'workerinput')
259-
"""
260-
)
261-
result = testdir.runpytest("-n1")
262-
result.stdout.fnmatch_lines("*1 passed*")
263-
assert result.ret == 0
264-
265249
def test_data_exchange(self, testdir):
266250
testdir.makeconftest(
267251
"""

0 commit comments

Comments
 (0)