Modify devel/py-rfc6555 to use python 3's built-in mock rather than the

backport devel/py-mock.

Patches to test upstreamed so will be unnecessary in a future release.

Input and ok sthen@
This commit is contained in:
kmos 2019-09-13 12:58:08 +00:00
parent d9b00166ff
commit 785758099d
3 changed files with 44 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.1.1.1 2019/08/24 20:13:01 remi Exp $
# $OpenBSD: Makefile,v 1.2 2019/09/13 12:58:08 kmos Exp $
COMMENT = implementation of the Happy Eyeballs Algorithm
@ -27,8 +27,8 @@ FLAVOR ?=
.if !${FLAVOR:Mpython3}
RUN_DEPENDS = devel/py-selectors2
TEST_DEPENDS = devel/py-mock
.endif
TEST_DEPENDS = devel/py-mock${MODPY_FLAVOR}
.include <bsd.port.mk>

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-tests_test_create_connection_py,v 1.1 2019/09/13 12:58:08 kmos Exp $
Only require mock and selectors 2 for Python 2.x
Pull request:
https://patch-diff.githubusercontent.com/raw/sethmlarson/rfc6555/pull/3
Index: tests/test_create_connection.py
--- tests/test_create_connection.py.orig
+++ tests/test_create_connection.py
@@ -1,4 +1,8 @@
-import mock
+try:
+ from unittest import mock
+except (ImportError, AttributeError):
+ import mock
+
import pytest
import socket
import rfc6555

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-tests_test_ipv6_py,v 1.1 2019/09/13 12:58:08 kmos Exp $
Only require mock and selectors 2 for Python 2.x
Pull request:
https://patch-diff.githubusercontent.com/raw/sethmlarson/rfc6555/pull/3
Index: tests/test_ipv6.py
--- tests/test_ipv6.py.orig
+++ tests/test_ipv6.py
@@ -1,6 +1,10 @@
import socket
-import mock
import rfc6555
+
+try:
+ from unittest import mock
+except (ImportError, AttributeError):
+ import mock
def test_ipv6_available():