forked from pool/python-pyudev
- Add remove_mock.patch gh#pyudev/pyudev#409 - Static linting with pylint is not needed for unit tests or build OBS-URL: https://build.opensuse.org/request/show/855370 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyudev?expand=0&rev=40
180 lines
4.9 KiB
Diff
180 lines
4.9 KiB
Diff
Index: pyudev-0.22.0/tests/_device_tests/_device_tests.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/_device_tests/_device_tests.py
|
|
+++ pyudev-0.22.0/tests/_device_tests/_device_tests.py
|
|
@@ -36,7 +36,10 @@ from hypothesis import settings
|
|
from hypothesis import strategies
|
|
|
|
import pytest
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
from pyudev import Device
|
|
from pyudev import Devices
|
|
Index: pyudev-0.22.0/tests/_device_tests/_tags_tests.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/_device_tests/_tags_tests.py
|
|
+++ pyudev-0.22.0/tests/_device_tests/_tags_tests.py
|
|
@@ -30,7 +30,10 @@ from hypothesis import settings
|
|
from hypothesis import strategies
|
|
|
|
import pytest
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
from pyudev import Devices
|
|
|
|
Index: pyudev-0.22.0/tests/plugins/mock_libudev.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/plugins/mock_libudev.py
|
|
+++ pyudev-0.22.0/tests/plugins/mock_libudev.py
|
|
@@ -33,7 +33,10 @@ from contextlib import contextmanager
|
|
from collections import namedtuple
|
|
|
|
import pytest
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
Node = namedtuple('Node', 'name value next')
|
|
|
|
Index: pyudev-0.22.0/tests/test_core.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/test_core.py
|
|
+++ pyudev-0.22.0/tests/test_core.py
|
|
@@ -21,7 +21,10 @@ from __future__ import (print_function,
|
|
import random
|
|
import syslog
|
|
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
from pyudev import udev_version
|
|
|
|
Index: pyudev-0.22.0/tests/test_enumerate.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/test_enumerate.py
|
|
+++ pyudev-0.22.0/tests/test_enumerate.py
|
|
@@ -18,7 +18,10 @@
|
|
from __future__ import (print_function, division, unicode_literals,
|
|
absolute_import)
|
|
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
import pytest
|
|
|
|
from hypothesis import given
|
|
Index: pyudev-0.22.0/tests/test_monitor.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/test_monitor.py
|
|
+++ pyudev-0.22.0/tests/test_monitor.py
|
|
@@ -24,7 +24,10 @@ from contextlib import contextmanager
|
|
from select import select
|
|
|
|
import pytest
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
from pyudev import Monitor, MonitorObserver, Devices
|
|
|
|
Index: pyudev-0.22.0/tests/test_observer.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/test_observer.py
|
|
+++ pyudev-0.22.0/tests/test_observer.py
|
|
@@ -21,7 +21,10 @@ from __future__ import (print_function,
|
|
import random
|
|
|
|
import pytest
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
from pyudev import Monitor, Devices
|
|
|
|
Index: pyudev-0.22.0/tests/test_observer_deprecated.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/test_observer_deprecated.py
|
|
+++ pyudev-0.22.0/tests/test_observer_deprecated.py
|
|
@@ -19,7 +19,10 @@ from __future__ import (print_function,
|
|
absolute_import)
|
|
|
|
import pytest
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
from pyudev import Monitor, Devices
|
|
|
|
Index: pyudev-0.22.0/requirements.txt
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/requirements.txt
|
|
+++ pyudev-0.22.0/requirements.txt
|
|
@@ -1,7 +1,7 @@
|
|
# unit test requirements
|
|
docutils>=0.9
|
|
pytest>=2.8
|
|
-mock>=1.0b1
|
|
+mock>=1.0b1; python_version < "3.3"
|
|
hypothesis==4.11.7
|
|
|
|
# documentation requirements
|
|
Index: pyudev-0.22.0/tox.ini
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tox.ini
|
|
+++ pyudev-0.22.0/tox.ini
|
|
@@ -6,7 +6,7 @@ setenv=LD_LIBRARY_PATH={envdir}/lib
|
|
deps=
|
|
docutils>=0.9
|
|
pytest>=3.0
|
|
- mock>=1.0b1
|
|
+ mock>=1.0b1; python_version < "3.3"
|
|
coverage
|
|
hypothesis
|
|
commands=
|
|
@@ -18,7 +18,7 @@ commands=
|
|
[testenv:doc]
|
|
downloadcache={toxworkdir}/_download
|
|
deps=
|
|
- mock>=1.0b1
|
|
+ mock>=1.0b1; python_version < "3.3"
|
|
pytest>=2.8
|
|
sphinx>=1.0.7
|
|
commands=
|
|
Index: pyudev-0.22.0/tests/test_util.py
|
|
===================================================================
|
|
--- pyudev-0.22.0.orig/tests/test_util.py
|
|
+++ pyudev-0.22.0/tests/test_util.py
|
|
@@ -21,7 +21,10 @@ from __future__ import (print_function,
|
|
import sys
|
|
|
|
import pytest
|
|
-from mock import Mock
|
|
+try:
|
|
+ from unittest.mock import Mock
|
|
+except ImportError:
|
|
+ from mock import Mock
|
|
|
|
from hypothesis import given
|
|
from hypothesis import settings
|