Accepting request 690274 from devel:languages:python:pytest
- Update to 1.6.0: * ``execnet`` no longer supports Python 2.6 and 3.3 (#85). Users of those Python versions using a recent enough ``pip`` should not be affected, as ``pip`` will only install ``1.5.0`` for them. * Update test suite to support ``pytest>4``. - Remove pytest4.patch merged upstream - Remove fix_apipkg.patch merged upstream OBS-URL: https://build.opensuse.org/request/show/690274 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-execnet?expand=0&rev=8
This commit is contained in:
commit
4729e07f8c
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a
|
||||
size 168497
|
3
execnet-1.6.0.tar.gz
Normal file
3
execnet-1.6.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:752a3786f17416d491f833a29217dda3ea4a471fc5269c492eebcee8cc4772d3
|
||||
size 169744
|
@ -1,29 +0,0 @@
|
||||
From a59f30af7cfbeed4666cc978913dfde66ca9f571 Mon Sep 17 00:00:00 2001
|
||||
From: Anthony Sottile <asottile@umich.edu>
|
||||
Date: Thu, 5 Jul 2018 15:14:35 -0700
|
||||
Subject: [PATCH] Don't copy apipkg into the test dir -- it isn't a single file
|
||||
any more
|
||||
|
||||
---
|
||||
testing/test_termination.py | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/testing/test_termination.py b/testing/test_termination.py
|
||||
index 7320cdf..ae905d4 100644
|
||||
--- a/testing/test_termination.py
|
||||
+++ b/testing/test_termination.py
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
import execnet
|
||||
-import apipkg
|
||||
import subprocess
|
||||
import py
|
||||
import sys
|
||||
@@ -76,7 +75,6 @@ def test_close_initiating_remote_no_error(testdir, anypython):
|
||||
print ("termination")
|
||||
execnet.default_group.terminate()
|
||||
""")
|
||||
- testdir.makepyfile(apipkg=apipkg)
|
||||
popen = subprocess.Popen(
|
||||
[str(anypython), str(p), str(execnetdir)],
|
||||
stdout=None, stderr=subprocess.PIPE,)
|
284
pytest4.patch
284
pytest4.patch
@ -1,284 +0,0 @@
|
||||
From d62f6a3d2ea92e577664ed14f489b02ab85382f8 Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Oliveira <nicoddemus@gmail.com>
|
||||
Date: Tue, 22 Jan 2019 17:59:31 -0200
|
||||
Subject: [PATCH 1/3] Use a modern fixture instead of removed cached_setup
|
||||
(pytest 4.1)
|
||||
|
||||
This require us to remove the --gwscope option because we won't
|
||||
be able to parametrize the fixture based on the deprecated
|
||||
'pytest.config' variable
|
||||
|
||||
Also remove pytest_report_header: it was displaying the removed "scope" option
|
||||
and execnet's version, which seems odd and not very useful nowadays
|
||||
|
||||
WIP
|
||||
---
|
||||
testing/conftest.py | 29 ++++++++++-------------------
|
||||
1 file changed, 10 insertions(+), 19 deletions(-)
|
||||
|
||||
Index: execnet-1.5.0/testing/conftest.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/conftest.py
|
||||
+++ execnet-1.5.0/testing/conftest.py
|
||||
@@ -44,10 +44,6 @@ def pytest_addoption(parser):
|
||||
'--gx', action="append", dest="gspecs", default=None,
|
||||
help=("add a global test environment, XSpec-syntax. "))
|
||||
group.addoption(
|
||||
- '--gwscope', action="store", dest="scope", default="session",
|
||||
- type="choice", choices=["session", "function"],
|
||||
- help=("set gateway setup scope, default: session."))
|
||||
- group.addoption(
|
||||
'--pypy', action="store_true", dest="pypy",
|
||||
help=("run some tests also against pypy"))
|
||||
group.addoption(
|
||||
@@ -56,13 +52,6 @@ def pytest_addoption(parser):
|
||||
"page on invalid addresses"))
|
||||
|
||||
|
||||
-def pytest_report_header(config):
|
||||
- return [
|
||||
- "gateway test setup scope: %s" % config.getvalue("scope"),
|
||||
- "execnet: %s -- %s" % (execnet.__file__, execnet.__version__),
|
||||
- ]
|
||||
-
|
||||
-
|
||||
@pytest.fixture
|
||||
def specssh(request):
|
||||
return getspecssh(request.config)
|
||||
@@ -149,22 +138,22 @@ def anypython(request):
|
||||
executable = None
|
||||
py.test.skip("no %s found" % (name,))
|
||||
if "execmodel" in request.fixturenames and name != 'sys.executable':
|
||||
- backend = request.getfuncargvalue("execmodel").backend
|
||||
+ backend = request.getfixturevalue("execmodel").backend
|
||||
if backend != "thread":
|
||||
pytest.xfail(
|
||||
"cannot run %r execmodel with bare %s" % (backend, name))
|
||||
return executable
|
||||
|
||||
|
||||
+@pytest.fixture(scope='session')
|
||||
+def group():
|
||||
+ g = execnet.Group()
|
||||
+ yield g
|
||||
+ g.terminate(timeout=1)
|
||||
+
|
||||
+
|
||||
@pytest.fixture
|
||||
-def gw(request, execmodel):
|
||||
- scope = request.config.option.scope
|
||||
- group = request.cached_setup(
|
||||
- setup=execnet.Group,
|
||||
- teardown=lambda group: group.terminate(timeout=1),
|
||||
- extrakey="testgroup",
|
||||
- scope=scope,
|
||||
- )
|
||||
+def gw(request, execmodel, group):
|
||||
try:
|
||||
return group[request.param]
|
||||
except KeyError:
|
||||
@@ -185,7 +174,7 @@ def gw(request, execmodel):
|
||||
gw.proxygw = proxygw
|
||||
assert pname in group
|
||||
elif request.param == "ssh":
|
||||
- sshhost = request.getfuncargvalue('specssh').ssh
|
||||
+ sshhost = request.getfixturevalue('specssh').ssh
|
||||
# we don't use execmodel.backend here
|
||||
# but you can set it when specifying the ssh spec
|
||||
gw = group.makegateway("ssh=%s//id=ssh" % (sshhost,))
|
||||
@@ -193,6 +182,8 @@ def gw(request, execmodel):
|
||||
group.makegateway('popen//id=proxy-transport')
|
||||
gw = group.makegateway('popen//via=proxy-transport//id=proxy'
|
||||
'//execmodel=%s' % execmodel.backend)
|
||||
+ else:
|
||||
+ assert 0, "unknown execmodel: {}".format(request.param)
|
||||
return gw
|
||||
|
||||
|
||||
Index: execnet-1.5.0/testing/test_serializer.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_serializer.py
|
||||
+++ execnet-1.5.0/testing/test_serializer.py
|
||||
@@ -116,12 +116,12 @@ def py3(request):
|
||||
|
||||
@pytest.fixture(params=['py2', 'py3'])
|
||||
def dump(request):
|
||||
- return request.getfuncargvalue(request.param).dump
|
||||
+ return request.getfixturevalue(request.param).dump
|
||||
|
||||
|
||||
@pytest.fixture(params=['py2', 'py3'])
|
||||
def load(request):
|
||||
- return request.getfuncargvalue(request.param).load
|
||||
+ return request.getfixturevalue(request.param).load
|
||||
|
||||
|
||||
simple_tests = [
|
||||
Index: execnet-1.5.0/testing/test_basics.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_basics.py
|
||||
+++ execnet-1.5.0/testing/test_basics.py
|
||||
@@ -387,8 +387,10 @@ def test_remote_exec_function_with_kwarg
|
||||
|
||||
def test_remote_exc__no_kwargs(makegateway):
|
||||
gw = makegateway()
|
||||
- pytest.raises(TypeError, gw.remote_exec, gateway_base, kwarg=1)
|
||||
- pytest.raises(TypeError, gw.remote_exec, 'pass', kwarg=1)
|
||||
+ with pytest.raises(TypeError):
|
||||
+ gw.remote_exec(gateway_base, kwarg=1)
|
||||
+ with pytest.raises(TypeError):
|
||||
+ gw.remote_exec('pass', kwarg=1)
|
||||
|
||||
|
||||
@skip_win_pypy
|
||||
Index: execnet-1.5.0/testing/test_channel.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_channel.py
|
||||
+++ execnet-1.5.0/testing/test_channel.py
|
||||
@@ -37,7 +37,8 @@ class TestChannelBasicBehaviour:
|
||||
|
||||
def test_channel_receive_timeout(self, gw):
|
||||
channel = gw.remote_exec('channel.send(channel.receive())')
|
||||
- pytest.raises(channel.TimeoutError, "channel.receive(timeout=0.2)")
|
||||
+ with pytest.raises(channel.TimeoutError):
|
||||
+ channel.receive(timeout=0.2)
|
||||
channel.send(1)
|
||||
channel.receive(timeout=TESTTIMEOUT)
|
||||
|
||||
@@ -263,9 +264,8 @@ class TestChannelBasicBehaviour:
|
||||
""")
|
||||
subchan = channel.receive()
|
||||
subchan.send(1)
|
||||
- excinfo = pytest.raises(
|
||||
- subchan.RemoteError,
|
||||
- "subchan.waitclose(TESTTIMEOUT)")
|
||||
+ with pytest.raises(subchan.RemoteError) as excinfo:
|
||||
+ subchan.waitclose(TESTTIMEOUT)
|
||||
assert "42" in excinfo.value.formatted
|
||||
channel.send(1)
|
||||
channel.waitclose()
|
||||
@@ -289,7 +289,8 @@ class TestChannelFile:
|
||||
f = channel.makefile()
|
||||
assert not f.isatty()
|
||||
channel.waitclose(TESTTIMEOUT)
|
||||
- pytest.raises(IOError, f.write, 'hello')
|
||||
+ with pytest.raises(IOError):
|
||||
+ f.write('hello')
|
||||
|
||||
def test_channel_file_proxyclose(self, gw):
|
||||
channel = gw.remote_exec("""
|
||||
Index: execnet-1.5.0/testing/test_gateway.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_gateway.py
|
||||
+++ execnet-1.5.0/testing/test_gateway.py
|
||||
@@ -136,9 +136,8 @@ class TestBasicGateway:
|
||||
|
||||
def test_remote_exec_no_explicit_close(self, gw):
|
||||
channel = gw.remote_exec('channel.close()')
|
||||
- excinfo = py.test.raises(
|
||||
- channel.RemoteError,
|
||||
- "channel.waitclose(TESTTIMEOUT)")
|
||||
+ with pytest.raises(channel.RemoteError) as excinfo:
|
||||
+ channel.waitclose(TESTTIMEOUT)
|
||||
assert "explicit" in excinfo.value.formatted
|
||||
|
||||
def test_remote_exec_channel_anonymous(self, gw):
|
||||
@@ -216,9 +215,8 @@ class TestPopenGateway:
|
||||
assert x.lower() == str(waschangedir).lower()
|
||||
|
||||
def test_remoteerror_readable_traceback(self, gw):
|
||||
- e = py.test.raises(
|
||||
- gateway_base.RemoteError,
|
||||
- 'gw.remote_exec("x y").waitclose()')
|
||||
+ with pytest.raises(gateway_base.RemoteError) as e:
|
||||
+ gw.remote_exec("x y").waitclose()
|
||||
assert "gateway_base" in e.value.formatted
|
||||
|
||||
def test_many_popen(self, makegateway):
|
||||
@@ -251,9 +249,12 @@ class TestPopenGateway:
|
||||
""")
|
||||
remotepid = channel.receive()
|
||||
py.process.kill(remotepid)
|
||||
- py.test.raises(EOFError, "channel.waitclose(TESTTIMEOUT)")
|
||||
- py.test.raises(IOError, channel.send, None)
|
||||
- py.test.raises(EOFError, channel.receive)
|
||||
+ with pytest.raises(EOFError):
|
||||
+ channel.waitclose(TESTTIMEOUT)
|
||||
+ with pytest.raises(IOError):
|
||||
+ channel.send(None)
|
||||
+ with pytest.raises(EOFError):
|
||||
+ channel.receive()
|
||||
|
||||
def test_receive_on_remote_sysexit(self, gw):
|
||||
channel = gw.remote_exec("""
|
||||
@@ -370,8 +371,8 @@ class TestThreads:
|
||||
class TestTracing:
|
||||
def test_popen_filetracing(self, testdir, monkeypatch, makegateway):
|
||||
tmpdir = testdir.tmpdir
|
||||
- monkeypatch.setenv("TMP", tmpdir)
|
||||
- monkeypatch.setenv("TEMP", tmpdir) # windows
|
||||
+ monkeypatch.setenv("TMP", str(tmpdir))
|
||||
+ monkeypatch.setenv("TEMP", str(tmpdir)) # windows
|
||||
monkeypatch.setenv('EXECNET_DEBUG', "1")
|
||||
gw = makegateway("popen")
|
||||
# hack out the debuffilename
|
||||
Index: execnet-1.5.0/testing/test_multi.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_multi.py
|
||||
+++ execnet-1.5.0/testing/test_multi.py
|
||||
@@ -175,14 +175,17 @@ class TestGroup:
|
||||
group = Group()
|
||||
gw = group.makegateway("popen//id=hello")
|
||||
assert group["hello"] == gw
|
||||
- py.test.raises((TypeError, AttributeError), "del group['hello']")
|
||||
- py.test.raises((TypeError, AttributeError), "group['hello'] = 5")
|
||||
+ with pytest.raises((TypeError, AttributeError)):
|
||||
+ del group['hello']
|
||||
+ with pytest.raises((TypeError, AttributeError)):
|
||||
+ group['hello'] = 5
|
||||
assert 'hello' in group
|
||||
assert gw in group
|
||||
assert len(group) == 1
|
||||
gw.exit()
|
||||
assert 'hello' not in group
|
||||
- py.test.raises(KeyError, "group['hello']")
|
||||
+ with pytest.raises(KeyError):
|
||||
+ _ = group['hello']
|
||||
|
||||
def test_default_group(self):
|
||||
oldlist = list(execnet.default_group)
|
||||
Index: execnet-1.5.0/testing/test_rsync.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_rsync.py
|
||||
+++ execnet-1.5.0/testing/test_rsync.py
|
||||
@@ -90,12 +90,14 @@ class TestRSync:
|
||||
rsync.add_target(gw1, dirs.dest1)
|
||||
rsync.send()
|
||||
assert dirs.dest1.join('hello').check()
|
||||
- py.test.raises(IOError, "rsync.send()")
|
||||
+ with pytest.raises(IOError):
|
||||
+ rsync.send()
|
||||
assert rsync.send(raises=False) is None
|
||||
rsync.add_target(gw1, dirs.dest2)
|
||||
rsync.send()
|
||||
assert dirs.dest2.join('hello').check()
|
||||
- py.test.raises(IOError, "rsync.send()")
|
||||
+ with pytest.raises(IOError):
|
||||
+ rsync.send()
|
||||
assert rsync.send(raises=False) is None
|
||||
|
||||
def test_rsync_default_reporting(self, capsys, dirs, gw1):
|
||||
Index: execnet-1.5.0/testing/test_xspec.py
|
||||
===================================================================
|
||||
--- execnet-1.5.0.orig/testing/test_xspec.py
|
||||
+++ execnet-1.5.0/testing/test_xspec.py
|
||||
@@ -23,7 +23,8 @@ class TestXSpec:
|
||||
assert spec.nice is None
|
||||
assert not hasattr(spec, '_xyz')
|
||||
|
||||
- pytest.raises(AttributeError, "spec._hello")
|
||||
+ with pytest.raises(AttributeError):
|
||||
+ spec._hello()
|
||||
|
||||
spec = XSpec("socket=192.168.102.2:8888//python=python2.5//nice=3")
|
||||
assert spec.socket == "192.168.102.2:8888"
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 1 08:31:46 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Update to 1.6.0:
|
||||
* ``execnet`` no longer supports Python 2.6 and 3.3 (#85). Users of those Python versions
|
||||
using a recent enough ``pip`` should not be affected, as ``pip`` will only install
|
||||
``1.5.0`` for them.
|
||||
* Update test suite to support ``pytest>4``.
|
||||
- Remove pytest4.patch merged upstream
|
||||
- Remove fix_apipkg.patch merged upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 12 14:25:44 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
@ -18,15 +18,13 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-execnet
|
||||
Version: 1.5.0
|
||||
Version: 1.6.0
|
||||
Release: 0
|
||||
Summary: Rapid multi-Python deployment
|
||||
License: MIT
|
||||
Group: Development/Libraries/Python
|
||||
URL: https://github.com/pytest-dev/execnet
|
||||
Source0: https://files.pythonhosted.org/packages/source/e/execnet/execnet-%{version}.tar.gz
|
||||
Patch0: fix_apipkg.patch
|
||||
Patch1: pytest4.patch
|
||||
BuildRequires: %{python_module apipkg}
|
||||
BuildRequires: %{python_module base}
|
||||
BuildRequires: %{python_module pytest}
|
||||
@ -51,8 +49,6 @@ API targetting the following uses:
|
||||
|
||||
%prep
|
||||
%setup -q -n execnet-%{version}
|
||||
%autopatch -p1
|
||||
|
||||
sed -i "1d" execnet/script/shell.py execnet/script/socketserver.py
|
||||
|
||||
%build
|
||||
|
Loading…
Reference in New Issue
Block a user