Remove py-mock from the python3 flavor of py-freezegun.
It requires some patching of tests. I've sent the patches upstream:
https://github.com/spulec/freezegun/pull/308
No revision bump since this is just tests.
--Kurt
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/py-freezegun/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile 4 Jul 2019 18:57:50 -0000 1.5
+++ Makefile 13 Sep 2019 21:49:19 -0000
@@ -22,13 +22,14 @@ MODPY_PYTEST = Yes
RUN_DEPENDS = devel/py-dateutil${MODPY_FLAVOR} \
devel/py-six${MODPY_FLAVOR}
TEST_DEPENDS = devel/py-nose${MODPY_FLAVOR} \
- devel/py-coverage${MODPY_FLAVOR} \
- devel/py-mock${MODPY_FLAVOR}
+ devel/py-coverage${MODPY_FLAVOR}
FLAVORS = python3
FLAVOR ?=
.if !${FLAVOR:Mpython3}
+TEST_DEPENDS += devel/py-mock
+
post-extract:
rm ${WRKSRC}/freezegun/_async.py
.endif
Index: patches/patch-setup_py
===================================================================
RCS file: patches/patch-setup_py
diff -N patches/patch-setup_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-setup_py 13 Sep 2019 21:49:19 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Only require mock for python 2
+
+Upstreamed via https://github.com/spulec/freezegun/pull/308
+
+Index: setup.py
+--- setup.py.orig
++++ setup.py
+@@ -4,7 +4,10 @@ import sys
+ from setuptools import setup
+
+ requires = ['six']
+-tests_require = ['mock', 'nose']
++tests_require = [
++ 'mock;python_version<"3.4"',
++ 'nose'
++]
+
+ if sys.version_info.major == 2:
+ requires += ['python-dateutil>=1.0, != 2.0']
Index: patches/patch-tests_test_ticking_py
===================================================================
RCS file: patches/patch-tests_test_ticking_py
diff -N patches/patch-tests_test_ticking_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_test_ticking_py 13 Sep 2019 21:49:19 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Only require mock for python 2
+
+Upstreamed via https://github.com/spulec/freezegun/pull/308
+
+Index: tests/test_ticking.py
+--- tests/test_ticking.py.orig
++++ tests/test_ticking.py
+@@ -1,6 +1,9 @@
+ import datetime
+ import time
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from freezegun import freeze_time
Index: patches/patch-tests_test_utils_py
===================================================================
RCS file: patches/patch-tests_test_utils_py
diff -N patches/patch-tests_test_utils_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_test_utils_py 13 Sep 2019 21:49:19 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Only require mock for python 2
+
+Upstreamed via https://github.com/spulec/freezegun/pull/308
+
+Index: tests/test_utils.py
+--- tests/test_utils.py.orig
++++ tests/test_utils.py
+@@ -1,6 +1,9 @@
+ from unittest import SkipTest
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+
+ from freezegun import api
+ from tests import utils
No comments:
Post a Comment