summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac-HD <zac.hatfield.dodds@gmail.com>2020-06-12 22:13:52 +1000
committerZac-HD <zac.hatfield.dodds@gmail.com>2020-06-12 22:49:33 +1000
commit564b2f707dd558d10974268ab5a5494de2f90238 (patch)
tree980d1a03ecac7707fe8cb4a0bfe3b052df09c059
parent0821c5c81d115c161a081fc048e4cf59521fe17e (diff)
downloadpytest-564b2f707dd558d10974268ab5a5494de2f90238.tar.gz
Finish deprecation of "slave"
-rw-r--r--changelog/7356.trivial.rst1
-rw-r--r--doc/en/announce/release-2.3.5.rst2
-rw-r--r--doc/en/announce/release-2.6.1.rst2
-rw-r--r--doc/en/changelog.rst6
-rw-r--r--doc/en/funcarg_compare.rst2
-rwxr-xr-xsrc/_pytest/cacheprovider.py4
-rw-r--r--src/_pytest/junitxml.py12
-rw-r--r--src/_pytest/pastebin.py2
-rw-r--r--src/_pytest/reports.py10
-rw-r--r--src/_pytest/resultlog.py4
-rw-r--r--testing/test_junitxml.py8
-rw-r--r--testing/test_resultlog.py4
12 files changed, 29 insertions, 28 deletions
diff --git a/changelog/7356.trivial.rst b/changelog/7356.trivial.rst
new file mode 100644
index 000000000..d280e2291
--- /dev/null
+++ b/changelog/7356.trivial.rst
@@ -0,0 +1 @@
+Remove last internal uses of deprecated "slave" term from old pytest-xdist.
diff --git a/doc/en/announce/release-2.3.5.rst b/doc/en/announce/release-2.3.5.rst
index 465dd826e..d68780a24 100644
--- a/doc/en/announce/release-2.3.5.rst
+++ b/doc/en/announce/release-2.3.5.rst
@@ -46,7 +46,7 @@ Changes between 2.3.4 and 2.3.5
- Issue 265 - integrate nose setup/teardown with setupstate
so it doesn't try to teardown if it did not setup
-- issue 271 - don't write junitxml on slave nodes
+- issue 271 - don't write junitxml on worker nodes
- Issue 274 - don't try to show full doctest example
when doctest does not know the example location
diff --git a/doc/en/announce/release-2.6.1.rst b/doc/en/announce/release-2.6.1.rst
index fba6f2993..85d986164 100644
--- a/doc/en/announce/release-2.6.1.rst
+++ b/doc/en/announce/release-2.6.1.rst
@@ -32,7 +32,7 @@ Changes 2.6.1
purely the nodeid. The line number is still shown in failure reports.
Thanks Floris Bruynooghe.
-- fix issue437 where assertion rewriting could cause pytest-xdist slaves
+- fix issue437 where assertion rewriting could cause pytest-xdist worker nodes
to collect different tests. Thanks Bruno Oliveira.
- fix issue555: add "errors" attribute to capture-streams to satisfy
diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst
index 1a298072b..2806fb6a3 100644
--- a/doc/en/changelog.rst
+++ b/doc/en/changelog.rst
@@ -6159,7 +6159,7 @@ time or change existing behaviors in order to make them less surprising/more use
purely the nodeid. The line number is still shown in failure reports.
Thanks Floris Bruynooghe.
-- fix issue437 where assertion rewriting could cause pytest-xdist slaves
+- fix issue437 where assertion rewriting could cause pytest-xdist worker nodes
to collect different tests. Thanks Bruno Oliveira.
- fix issue555: add "errors" attribute to capture-streams to satisfy
@@ -6706,7 +6706,7 @@ Bug fixes:
- Issue 265 - integrate nose setup/teardown with setupstate
so it doesn't try to teardown if it did not setup
-- issue 271 - don't write junitxml on slave nodes
+- issue 271 - don't write junitxml on worker nodes
- Issue 274 - don't try to show full doctest example
when doctest does not know the example location
@@ -7588,7 +7588,7 @@ Bug fixes:
- fix assert reinterpreation that sees a call containing "keyword=..."
- fix issue66: invoke pytest_sessionstart and pytest_sessionfinish
- hooks on slaves during dist-testing, report module/session teardown
+ hooks on worker nodes during dist-testing, report module/session teardown
hooks correctly.
- fix issue65: properly handle dist-testing if no
diff --git a/doc/en/funcarg_compare.rst b/doc/en/funcarg_compare.rst
index af7030165..4350c98b6 100644
--- a/doc/en/funcarg_compare.rst
+++ b/doc/en/funcarg_compare.rst
@@ -170,7 +170,7 @@ several problems:
1. in distributed testing the master process would setup test resources
that are never needed because it only co-ordinates the test run
- activities of the slave processes.
+ activities of the worker processes.
2. if you only perform a collection (with "--collect-only")
resource-setup will still be executed.
diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py
index af7d57a24..9baee1d4e 100755
--- a/src/_pytest/cacheprovider.py
+++ b/src/_pytest/cacheprovider.py
@@ -341,7 +341,7 @@ class LFPlugin:
def pytest_sessionfinish(self, session: Session) -> None:
config = self.config
- if config.getoption("cacheshow") or hasattr(config, "slaveinput"):
+ if config.getoption("cacheshow") or hasattr(config, "workerinput"):
return
assert config.cache is not None
@@ -386,7 +386,7 @@ class NFPlugin:
def pytest_sessionfinish(self) -> None:
config = self.config
- if config.getoption("cacheshow") or hasattr(config, "slaveinput"):
+ if config.getoption("cacheshow") or hasattr(config, "workerinput"):
return
if config.getoption("collectonly"):
diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py
index 47ba89d38..e62bc5235 100644
--- a/src/_pytest/junitxml.py
+++ b/src/_pytest/junitxml.py
@@ -427,8 +427,8 @@ def pytest_addoption(parser: Parser) -> None:
def pytest_configure(config: Config) -> None:
xmlpath = config.option.xmlpath
- # prevent opening xmllog on slave nodes (xdist)
- if xmlpath and not hasattr(config, "slaveinput"):
+ # prevent opening xmllog on worker nodes (xdist)
+ if xmlpath and not hasattr(config, "workerinput"):
junit_family = config.getini("junit_family")
if not junit_family:
_issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)
@@ -506,17 +506,17 @@ class LogXML:
def finalize(self, report: TestReport) -> None:
nodeid = getattr(report, "nodeid", report)
# local hack to handle xdist report order
- slavenode = getattr(report, "node", None)
- reporter = self.node_reporters.pop((nodeid, slavenode))
+ workernode = getattr(report, "node", None)
+ reporter = self.node_reporters.pop((nodeid, workernode))
if reporter is not None:
reporter.finalize()
def node_reporter(self, report: Union[TestReport, str]) -> _NodeReporter:
nodeid = getattr(report, "nodeid", report) # type: Union[str, TestReport]
# local hack to handle xdist report order
- slavenode = getattr(report, "node", None)
+ workernode = getattr(report, "node", None)
- key = nodeid, slavenode
+ key = nodeid, workernode
if key in self.node_reporters:
# TODO: breaks for --dist=each
diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py
index 7e6bbf50c..a3432c7a1 100644
--- a/src/_pytest/pastebin.py
+++ b/src/_pytest/pastebin.py
@@ -33,7 +33,7 @@ def pytest_configure(config: Config) -> None:
if config.option.pastebin == "all":
tr = config.pluginmanager.getplugin("terminalreporter")
# if no terminal reporter plugin is present, nothing we can do here;
- # this can happen when this function executes in a slave node
+ # this can happen when this function executes in a worker node
# when using pytest-xdist, for example
if tr is not None:
# pastebin file will be utf-8 encoded binary file
diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py
index 7462cea0b..6a408354b 100644
--- a/src/_pytest/reports.py
+++ b/src/_pytest/reports.py
@@ -38,13 +38,13 @@ if TYPE_CHECKING:
from _pytest.runner import CallInfo
-def getslaveinfoline(node):
+def getworkerinfoline(node):
try:
- return node._slaveinfocache
+ return node._workerinfocache
except AttributeError:
- d = node.slaveinfo
+ d = node.workerinfo
ver = "%s.%s.%s" % d["version_info"][:3]
- node._slaveinfocache = s = "[{}] {} -- Python {} {}".format(
+ node._workerinfocache = s = "[{}] {} -- Python {} {}".format(
d["id"], d["sysplatform"], ver, d["executable"]
)
return s
@@ -71,7 +71,7 @@ class BaseReport:
def toterminal(self, out) -> None:
if hasattr(self, "node"):
- out.line(getslaveinfoline(self.node))
+ out.line(getworkerinfoline(self.node))
longrepr = self.longrepr
if longrepr is None:
diff --git a/src/_pytest/resultlog.py b/src/_pytest/resultlog.py
index c2b0cf556..c870ef08e 100644
--- a/src/_pytest/resultlog.py
+++ b/src/_pytest/resultlog.py
@@ -29,8 +29,8 @@ def pytest_addoption(parser: Parser) -> None:
def pytest_configure(config: Config) -> None:
resultlog = config.option.resultlog
- # prevent opening resultlog on slave nodes (xdist)
- if resultlog and not hasattr(config, "slaveinput"):
+ # prevent opening resultlog on worker nodes (xdist)
+ if resultlog and not hasattr(config, "workerinput"):
dirname = os.path.dirname(os.path.abspath(resultlog))
if not os.path.isdir(dirname):
os.makedirs(dirname)
diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py
index d7771cc97..f8a6a295f 100644
--- a/testing/test_junitxml.py
+++ b/testing/test_junitxml.py
@@ -866,12 +866,12 @@ def test_mangle_test_address():
assert newnames == ["a.my.py.thing", "Class", "method", "[a-1-::]"]
-def test_dont_configure_on_slaves(tmpdir) -> None:
+def test_dont_configure_on_workers(tmpdir) -> None:
gotten = [] # type: List[object]
class FakeConfig:
if TYPE_CHECKING:
- slaveinput = None
+ workerinput = None
def __init__(self):
self.pluginmanager = self
@@ -891,7 +891,7 @@ def test_dont_configure_on_slaves(tmpdir) -> None:
junitxml.pytest_configure(fake_config)
assert len(gotten) == 1
- FakeConfig.slaveinput = None
+ FakeConfig.workerinput = None
junitxml.pytest_configure(fake_config)
assert len(gotten) == 1
@@ -1250,7 +1250,7 @@ def test_record_fixtures_xunit2(testdir, fixture_name, run_and_parse):
def test_random_report_log_xdist(testdir, monkeypatch, run_and_parse):
- """xdist calls pytest_runtest_logreport as they are executed by the slaves,
+ """xdist calls pytest_runtest_logreport as they are executed by the workers,
with nodes from several nodes overlapping, so junitxml must cope with that
to produce correct reports. #1064
"""
diff --git a/testing/test_resultlog.py b/testing/test_resultlog.py
index bad575e3d..8fc93d25c 100644
--- a/testing/test_resultlog.py
+++ b/testing/test_resultlog.py
@@ -177,7 +177,7 @@ def test_makedir_for_resultlog(testdir, LineMatcher):
LineMatcher(lines).fnmatch_lines([". *:test_pass"])
-def test_no_resultlog_on_slaves(testdir):
+def test_no_resultlog_on_workers(testdir):
config = testdir.parseconfig("-p", "resultlog", "--resultlog=resultlog")
assert resultlog_key not in config._store
@@ -186,7 +186,7 @@ def test_no_resultlog_on_slaves(testdir):
pytest_unconfigure(config)
assert resultlog_key not in config._store
- config.slaveinput = {}
+ config.workerinput = {}
pytest_configure(config)
assert resultlog_key not in config._store
pytest_unconfigure(config)