aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2016-07-19 00:15:01 +0800
committerjbeich <jbeich@FreeBSD.org>2016-07-19 00:15:01 +0800
commita64253b6ab9647819c4581c9934b8d06870d53c7 (patch)
tree5b257c449ca2b53cb465e505ce3e85f0728e640e
parent34a9607eaf94b58a24279810e1f97927e5d8736f (diff)
downloadfreebsd-ports-graphics-a64253b6ab9647819c4581c9934b8d06870d53c7.tar.gz
freebsd-ports-graphics-a64253b6ab9647819c4581c9934b8d06870d53c7.tar.zst
freebsd-ports-graphics-a64253b6ab9647819c4581c9934b8d06870d53c7.zip
Invoke pytest from within desired python version
When testing a port for a non-default python py.test may fail to find dependencies for default version because they weren't built e.g., $ make test PYTHON_VERSION=python3.5 -C devel/py-apscheduler [...] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/_pytest/config.py", line 319, in _importconftest mod = conftestpath.pyimport() File "/usr/local/lib/python3.5/site-packages/py/_path/local.py", line 650, in pyimport __import__(modname) File "/usr/ports/devel/py-apscheduler/work/APScheduler-3.2.0/tests/conftest.py", line 8, in <module> from apscheduler.job import Job File "/usr/ports/devel/py-apscheduler/work/APScheduler-3.2.0/apscheduler/job.py", line 4, in <module> import six ImportError: No module named 'six' ERROR: could not load /usr/ports/devel/py-apscheduler/work/APScheduler-3.2.0/tests/conftest.py Approved by: portmgr blanket
-rw-r--r--databases/py-sqlalchemy09/Makefile2
-rw-r--r--databases/py-sqlalchemy10/Makefile2
-rw-r--r--devel/py-apscheduler/Makefile2
-rw-r--r--devel/py-cffi/Makefile5
-rw-r--r--devel/py-pytest-xdist/Makefile2
-rw-r--r--sysutils/py-honcho/Makefile2
-rw-r--r--textproc/py-pyscss/Makefile2
7 files changed, 9 insertions, 8 deletions
diff --git a/databases/py-sqlalchemy09/Makefile b/databases/py-sqlalchemy09/Makefile
index 8a33a019944..165f2dfe5e7 100644
--- a/databases/py-sqlalchemy09/Makefile
+++ b/databases/py-sqlalchemy09/Makefile
@@ -76,6 +76,6 @@ do-test:
.if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/test
.endif
- @cd ${WRKSRC} && py.test
+ @(cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.post.mk>
diff --git a/databases/py-sqlalchemy10/Makefile b/databases/py-sqlalchemy10/Makefile
index 6b7afc06e92..a8970c1dd0c 100644
--- a/databases/py-sqlalchemy10/Makefile
+++ b/databases/py-sqlalchemy10/Makefile
@@ -76,6 +76,6 @@ do-test:
.if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/test
.endif
- @cd ${WRKSRC} && py.test
+ @(cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.post.mk>
diff --git a/devel/py-apscheduler/Makefile b/devel/py-apscheduler/Makefile
index 70a9dd972b7..acbd4e84579 100644
--- a/devel/py-apscheduler/Makefile
+++ b/devel/py-apscheduler/Makefile
@@ -43,6 +43,6 @@ post-patch:
${WRKSRC}/tests/test_schedulers.py
do-test:
- @(cd ${TEST_WRKSRC}; ${SETENV} ${TEST_ENV} py.test)
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.post.mk>
diff --git a/devel/py-cffi/Makefile b/devel/py-cffi/Makefile
index 3ff199674ae..178813b626c 100644
--- a/devel/py-cffi/Makefile
+++ b/devel/py-cffi/Makefile
@@ -24,7 +24,8 @@ USES= python
USE_PYTHON= autoplist distutils
do-test: patch
- cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} build_ext -i && \
- ${LOCALBASE}/bin/py.test
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \
+ ${PYDISTUTILS_SETUP} build_ext -i)
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.mk>
diff --git a/devel/py-pytest-xdist/Makefile b/devel/py-pytest-xdist/Makefile
index 8133b2efedd..97300d6eef3 100644
--- a/devel/py-pytest-xdist/Makefile
+++ b/devel/py-pytest-xdist/Makefile
@@ -29,6 +29,6 @@ post-extract:
${RM} -rf ${WRKSRC}/testing/__pycache__
do-test:
- @cd ${WRKSRC} && py.test
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.mk>
diff --git a/sysutils/py-honcho/Makefile b/sysutils/py-honcho/Makefile
index 313c48518f6..27c05a4c574 100644
--- a/sysutils/py-honcho/Makefile
+++ b/sysutils/py-honcho/Makefile
@@ -22,6 +22,6 @@ USES= python
USE_PYTHON= autoplist distutils
regression-test:
- @cd ${WRKSRC} && py.test
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.mk>
diff --git a/textproc/py-pyscss/Makefile b/textproc/py-pyscss/Makefile
index f75fbd9c07e..7ebd95a189e 100644
--- a/textproc/py-pyscss/Makefile
+++ b/textproc/py-pyscss/Makefile
@@ -27,6 +27,6 @@ USES= python
USE_PYTHON= distutils autoplist
regression-test: build
- @cd ${WRKSRC} && py.test
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
.include <bsd.port.mk>