Skip to content

Commit

Permalink
www/py-django-redis: Fix test suite
Browse files Browse the repository at this point in the history
* When running the test suite it cannot find the "runtests.py" script as
  it has changed over time in newer versions.  Thus, make the test suite
  usable again and switch to USE_PYTHON=pytest.

PR:		274790
Approved by:	maintainer timeout (1+ month)
  • Loading branch information
knobix committed Dec 8, 2023
1 parent 489b9c6 commit 201f201
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions www/py-django-redis/Makefile
Expand Up @@ -13,18 +13,25 @@ LICENSE_FILE= ${WRKSRC}/LICENSE

RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django32>=3.2:www/py-django32@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}redis>=3.0.0:databases/py-redis@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hiredis>=0:databases/py-hiredis@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}mock>=0:devel/py-mock@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}msgpack>=0:devel/py-msgpack@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}msgpack>=0:devel/py-msgpack@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-django>0:devel/py-pytest-django@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-mock>0:devel/py-pytest-mock@${PY_FLAVOR} \
redis-server:databases/redis

USES= python
USE_PYTHON= autoplist concurrent distutils
USE_PYTHON= autoplist concurrent distutils pytest

# Required for Python +3.11 as the 'cgi' module is deprecated and slated for
# removal in Python 3.13
TEST_ARGS= -W ignore::DeprecationWarning

TEST_ENV= DJANGO_SETTINGS_MODULE=settings.sqlite \
PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}

CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}*${PORTNAME}

NO_ARCH= yes

do-test:
@cd ${WRKSRC}/tests && ${PYTHON_CMD} runtests.py
TEST_WRKSRC= ${WRKSRC}/tests

.include <bsd.port.mk>

0 comments on commit 201f201

Please sign in to comment.