forked from pool/python-Fabric
* Add ~fabric.connection.Connection.shell, a belated port of the v1 open_shell() feature. * Forward local terminal resizes to the remote end, when applicable. (For the technical: this means we now turn SIGWINCH into SSH window-change messages.) * Update ~fabric.connection.Connection temporarily so that it doesn't incidentally apply replace_env=True to local shell commands, only remote ones. - Add patch remove-mock.patch: * Use unittest.mock, instead of mock OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Fabric?expand=0&rev=73
205 lines
6.2 KiB
Diff
205 lines
6.2 KiB
Diff
Index: fabric-2.7.0/fabric/testing/base.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/fabric/testing/base.py
|
|
+++ fabric-2.7.0/fabric/testing/base.py
|
|
@@ -20,7 +20,10 @@ from io import BytesIO
|
|
import os
|
|
|
|
try:
|
|
- from mock import Mock, PropertyMock, call, patch, ANY
|
|
+ try:
|
|
+ from unittest.mock import Mock, PropertyMock, call, patch, ANY
|
|
+ except ImportError:
|
|
+ from mock import Mock, PropertyMock, call, patch, ANY
|
|
except ImportError:
|
|
import warnings
|
|
|
|
Index: fabric-2.7.0/fabric/testing/fixtures.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/fabric/testing/fixtures.py
|
|
+++ fabric-2.7.0/fabric/testing/fixtures.py
|
|
@@ -17,7 +17,10 @@ For example, if you intend to use the `r
|
|
|
|
try:
|
|
from pytest import fixture
|
|
- from mock import patch, Mock
|
|
+ try:
|
|
+ from unittest.mock import patch, Mock
|
|
+ except ImportError:
|
|
+ from mock import patch, Mock
|
|
except ImportError:
|
|
import warnings
|
|
|
|
Index: fabric-2.7.0/setup.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/setup.py
|
|
+++ fabric-2.7.0/setup.py
|
|
@@ -77,8 +77,9 @@ setuptools.setup(
|
|
},
|
|
install_requires=["invoke>=1.3,<2.0", "paramiko>=2.4", "pathlib2"],
|
|
extras_require={
|
|
- "testing": testing_deps,
|
|
- "pytest": testing_deps + pytest_deps,
|
|
+ "testing:python_version<='3.3'": testing_deps,
|
|
+ "pytest:python_version<='3.3'": testing_deps + pytest_deps,
|
|
+ "pytest:python_version>='3.4'": pytest_deps,
|
|
},
|
|
packages=packages,
|
|
entry_points={
|
|
Index: fabric-2.7.0/tests/config.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/config.py
|
|
+++ fabric-2.7.0/tests/config.py
|
|
@@ -8,7 +8,10 @@ from lexicon import Lexicon
|
|
from fabric import Config, Remote, RemoteShell
|
|
from fabric.util import get_local_user
|
|
|
|
-from mock import patch, call
|
|
+try:
|
|
+ from unittest.mock import patch, call
|
|
+except ImportError:
|
|
+ from mock import patch, call
|
|
|
|
from _util import support, faux_v1_env
|
|
|
|
Index: fabric-2.7.0/tests/conftest.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/conftest.py
|
|
+++ fabric-2.7.0/tests/conftest.py
|
|
@@ -5,7 +5,10 @@ from os.path import isfile, expanduser
|
|
|
|
from pytest import fixture
|
|
|
|
-from mock import patch
|
|
+try:
|
|
+ from unittest.mock import patch
|
|
+except ImportError:
|
|
+ from mock import patch
|
|
|
|
|
|
# TODO: does this want to end up in the public fixtures module too?
|
|
Index: fabric-2.7.0/tests/connection.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/connection.py
|
|
+++ fabric-2.7.0/tests/connection.py
|
|
@@ -10,7 +10,10 @@ from os.path import join
|
|
import socket
|
|
import time
|
|
|
|
-from mock import patch, Mock, call, ANY
|
|
+try:
|
|
+ from unittest.mock import patch, Mock, call, ANY
|
|
+except ImportError:
|
|
+ from mock import patch, Mock, call, ANY
|
|
from paramiko.client import SSHClient, AutoAddPolicy
|
|
from paramiko import SSHConfig
|
|
import pytest # for mark, internal raises
|
|
Index: fabric-2.7.0/tests/executor.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/executor.py
|
|
+++ fabric-2.7.0/tests/executor.py
|
|
@@ -4,7 +4,10 @@ from fabric import Executor, Task, Conne
|
|
from fabric.executor import ConnectionCall
|
|
from fabric.exceptions import NothingToDo
|
|
|
|
-from mock import Mock
|
|
+try:
|
|
+ from unittest.mock import Mock
|
|
+except ImportError:
|
|
+ from mock import Mock
|
|
from pytest import skip, raises # noqa
|
|
|
|
|
|
Index: fabric-2.7.0/tests/group.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/group.py
|
|
+++ fabric-2.7.0/tests/group.py
|
|
@@ -1,4 +1,7 @@
|
|
-from mock import Mock, patch, call
|
|
+try:
|
|
+ from unittest.mock import Mock, patch, call
|
|
+except ImportError:
|
|
+ from mock import Mock, patch, call
|
|
from pytest import mark, raises
|
|
|
|
from fabric import Connection, Group, SerialGroup, ThreadingGroup, GroupResult
|
|
Index: fabric-2.7.0/tests/main.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/main.py
|
|
+++ fabric-2.7.0/tests/main.py
|
|
@@ -8,7 +8,10 @@ import re
|
|
|
|
from invoke import run
|
|
from invoke.util import cd
|
|
-from mock import patch
|
|
+try:
|
|
+ from unittest.mock import patch
|
|
+except ImportError:
|
|
+ from mock import patch
|
|
import pytest # because WHY would you expose @skip normally? -_-
|
|
from pytest_relaxed import raises
|
|
|
|
Index: fabric-2.7.0/tests/runners.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/runners.py
|
|
+++ fabric-2.7.0/tests/runners.py
|
|
@@ -3,7 +3,10 @@ try:
|
|
except ImportError:
|
|
from six import StringIO
|
|
|
|
-from mock import Mock, patch
|
|
+try:
|
|
+ from unittest.mock import Mock, patch
|
|
+except ImportError:
|
|
+ from mock import Mock, patch
|
|
from pytest import skip # noqa
|
|
|
|
from invoke import pty_size, Result
|
|
Index: fabric-2.7.0/tests/task.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/task.py
|
|
+++ fabric-2.7.0/tests/task.py
|
|
@@ -1,6 +1,9 @@
|
|
# NOTE: named task.py, not tasks.py, to avoid some occasional pytest weirdness
|
|
|
|
-from mock import Mock
|
|
+try:
|
|
+ from unittest.mock import Mock
|
|
+except ImportError:
|
|
+ from mock import Mock
|
|
from pytest import skip # noqa
|
|
|
|
import fabric
|
|
Index: fabric-2.7.0/tests/transfer.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/transfer.py
|
|
+++ fabric-2.7.0/tests/transfer.py
|
|
@@ -3,7 +3,10 @@ try:
|
|
except ImportError:
|
|
from six import StringIO
|
|
|
|
-from mock import Mock, call, patch
|
|
+try:
|
|
+ from unittest.mock import Mock, call, patch
|
|
+except ImportError:
|
|
+ from mock import Mock, call, patch
|
|
from pytest_relaxed import raises
|
|
from pytest import skip # noqa
|
|
from paramiko import SFTPAttributes
|
|
Index: fabric-2.7.0/tests/util.py
|
|
===================================================================
|
|
--- fabric-2.7.0.orig/tests/util.py
|
|
+++ fabric-2.7.0/tests/util.py
|
|
@@ -2,7 +2,10 @@
|
|
Tests testing the fabric.util module, not utils for the tests!
|
|
"""
|
|
|
|
-from mock import patch
|
|
+try:
|
|
+ from unittest.mock import patch
|
|
+except ImportError:
|
|
+ from mock import patch
|
|
|
|
from fabric.util import get_local_user
|
|
|