diff --git a/Finish-deprecation-of-illegal-keywords.patch b/Finish-deprecation-of-illegal-keywords.patch new file mode 100644 index 0000000000000000000000000000000000000000..21e8101ec222d56b59ff08a39deb23495f5a40f6 --- /dev/null +++ b/Finish-deprecation-of-illegal-keywords.patch @@ -0,0 +1,189 @@ +From 564b2f707dd558d10974268ab5a5494de2f90238 Mon Sep 17 00:00:00 2001 +From: Zac-HD +Date: Fri, 12 Jun 2020 22:13:52 +1000 +Subject: [PATCH] Finish deprecation of "slave" + +--- + src/_pytest/cacheprovider.py | 4 ++-- + src/_pytest/junitxml.py | 12 ++++++------ + src/_pytest/pastebin.py | 2 +- + src/_pytest/resultlog.py | 4 ++-- + src/_pytest/runner.py | 10 +++++----- + testing/test_junitxml.py | 6 +++--- + testing/test_resultlog.py | 4 ++-- + 7 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py +index 53b6ebb..9983c80 100755 +--- a/src/_pytest/cacheprovider.py ++++ b/src/_pytest/cacheprovider.py +@@ -170,7 +170,7 @@ class LFPlugin(object): + + def pytest_sessionfinish(self, session): + config = self.config +- if config.getoption("cacheshow") or hasattr(config, "slaveinput"): ++ if config.getoption("cacheshow") or hasattr(config, "workerinput"): + return + + saved_lastfailed = config.cache.get("cache/lastfailed", {}) +@@ -206,7 +206,7 @@ class NFPlugin(object): + + def pytest_sessionfinish(self, session): + config = self.config +- if config.getoption("cacheshow") or hasattr(config, "slaveinput"): ++ if config.getoption("cacheshow") or hasattr(config, "workerinput"): + return + + config.cache.set("cache/nodeids", self.cached_nodeids) +diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py +index 86aad69..9d381d9 100644 +--- a/src/_pytest/junitxml.py ++++ b/src/_pytest/junitxml.py +@@ -322,8 +322,8 @@ def pytest_addoption(parser): + + def pytest_configure(config): + 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"): + config._xml = LogXML( + xmlpath, + config.option.junitprefix, +@@ -373,17 +373,17 @@ class LogXML(object): + def finalize(self, report): + 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): + nodeid = getattr(report, "nodeid", report) + # 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: breasks for --dist=each +diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py +index 6af202d..95e5d5c 100644 +--- a/src/_pytest/pastebin.py ++++ b/src/_pytest/pastebin.py +@@ -25,7 +25,7 @@ def pytest_configure(config): + 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/resultlog.py b/src/_pytest/resultlog.py +index 0ad31b8..bb64c54 100644 +--- a/src/_pytest/resultlog.py ++++ b/src/_pytest/resultlog.py +@@ -21,8 +21,8 @@ def pytest_addoption(parser): + + def pytest_configure(config): + 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/src/_pytest/runner.py b/src/_pytest/runner.py +index ee53642..cc41ea0 100644 +--- a/src/_pytest/runner.py ++++ b/src/_pytest/runner.py +@@ -215,13 +215,13 @@ class CallInfo(object): + return "" % (self.when, status) + + +-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 = "[%s] %s -- Python %s %s" % ( ++ node._workerinfocache = s = "[%s] %s -- Python %s %s" % ( + d["id"], + d["sysplatform"], + ver, +@@ -236,7 +236,7 @@ class BaseReport(object): + + def toterminal(self, out): + if hasattr(self, "node"): +- out.line(getslaveinfoline(self.node)) ++ out.line(getworkerinfoline(self.node)) + + longrepr = self.longrepr + if longrepr is None: +diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py +index aa6b9a1..c27a9a4 100644 +--- a/testing/test_junitxml.py ++++ b/testing/test_junitxml.py +@@ -707,7 +707,7 @@ def test_mangle_test_address(): + assert newnames == ["a.my.py.thing", "Class", "method", "[a-1-::]"] + + +-def test_dont_configure_on_slaves(tmpdir): ++def test_dont_configure_on_workers(tmpdir): + gotten = [] + + class FakeConfig(object): +@@ -728,7 +728,7 @@ def test_dont_configure_on_slaves(tmpdir): + + junitxml.pytest_configure(fake_config) + assert len(gotten) == 1 +- FakeConfig.slaveinput = None ++ FakeConfig.workerinput = None + junitxml.pytest_configure(fake_config) + assert len(gotten) == 1 + +@@ -1027,7 +1027,7 @@ def test_record_attribute(testdir): + + + def test_random_report_log_xdist(testdir): +- """xdist calls pytest_runtest_logreport as they are executed by the slaves, ++ """xdist calls pytest_runtest_logreport as they are executed by the worker, + 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 173384f..add296f 100644 +--- a/testing/test_resultlog.py ++++ b/testing/test_resultlog.py +@@ -204,7 +204,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 not hasattr(config, "_resultlog") +@@ -213,7 +213,7 @@ def test_no_resultlog_on_slaves(testdir): + pytest_unconfigure(config) + assert not hasattr(config, "_resultlog") + +- config.slaveinput = {} ++ config.workerinput = {} + pytest_configure(config) + assert not hasattr(config, "_resultlog") + pytest_unconfigure(config) +-- +2.23.0 + diff --git a/pytest.spec b/pytest.spec index eb4b96332a7732a72792914df2b39bb8f7312f4c..a25ff00d9026918aa81604ce13d9fa35f3ddfbc0 100644 --- a/pytest.spec +++ b/pytest.spec @@ -6,11 +6,14 @@ Name: pytest Version: 3.6.4 -Release: 3 +Release: 4 Summary: A mature full-featured Python testing tool License: MIT URL: http://pytest.org Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +#This patch is used to replace illegal keywords. This midification only affects pytest-xdist. +#which can be deleted after pytest 6 version. +Patch0: Finish-deprecation-of-illegal-keywords.patch BuildArch: noarch %if 0%{?with_help} BuildRequires: %{_bindir}/sphinx-build-3 %{_bindir}/rst2html @@ -62,7 +65,7 @@ Obsoletes: platform-python-%{name} < %{version}-%{release} %prep -%autosetup +%autosetup -p1 %build %py2_build @@ -141,6 +144,9 @@ PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib} \ %endif %changelog +* Sat Aug 21 2021 huanghaitao - 3.6.4-4 +- Finish deprecation of illegal keywords. + * Tue Dec 10 2019 mengxian - 3.6.4-2 - Package init