devel/py-unittest2pytest: add port: Convert unittest test-cases to pytest

unittest2pytest is a tool that helps rewriting Python unittest
test-cases into pytest test-cases.

In contrast to other similar tools, this unittest2pytest

* handles keyword arguments,
* handles single-line test-cases and several tests on one line,
* uses context-handlers where appropriate.

This is done by using lib2to3 and Python's mighty inspect module.

WWW: https://pypi.org/project/unittest2pytest/
WWW: https://github.com/pytest-dev/unittest2pytest
This commit is contained in:
Dmitry Marakasov
2021-09-30 01:59:21 +03:00
parent 62744783a4
commit 7b513a3d17
4 changed files with 39 additions and 0 deletions

View File

@@ -5297,6 +5297,7 @@
SUBDIR += py-unicodedata2
SUBDIR += py-unipath
SUBDIR += py-unittest2
SUBDIR += py-unittest2pytest
SUBDIR += py-unpaddedbase64
SUBDIR += py-update_checker
SUBDIR += py-urlimport

View File

@@ -0,0 +1,22 @@
PORTNAME= unittest2pytest
PORTVERSION= 0.4
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Convert unittest test-cases to pytest
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING-GPLv3.txt
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=0:devel/py-pytest@${PY_FLAVOR}
USES= python
USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
do-test:
@cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs
.include <bsd.port.mk>

View File

@@ -0,0 +1,3 @@
TIMESTAMP = 1632956103
SHA256 (unittest2pytest-0.4.tar.gz) = a909522aa54787e20c1cabda9624bf81edcfe5107dc3c73a478ad2d0cf67c21f
SIZE (unittest2pytest-0.4.tar.gz) = 35465

View File

@@ -0,0 +1,13 @@
unittest2pytest is a tool that helps rewriting Python unittest
test-cases into pytest test-cases.
In contrast to other similar tools, this unittest2pytest
* handles keyword arguments,
* handles single-line test-cases and several tests on one line,
* uses context-handlers where appropriate.
This is done by using lib2to3 and Python's mighty inspect module.
WWW: https://pypi.org/project/unittest2pytest/
WWW: https://github.com/pytest-dev/unittest2pytest