# Contributor: Jacek Pruciak <alpine@juniorjpdj.pl>
# Maintainer: Jacek Pruciak <alpine@juniorjpdj.pl>
pkgname=py3-pytest-subtests
pkgver=0.11.0
pkgrel=1
pkgdesc="pytest plugin for subTest() support and subtests fixture"
url="https://github.com/pytest-dev/pytest-subtests/"
arch="noarch"
license="MIT"
depends="python3 py3-attrs py3-pytest"
makedepends="py3-setuptools py3-setuptools_scm py3-gpep517 py3-wheel py3-installer"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pytest-subtests/pytest-subtests-$pkgver.tar.gz"
builddir="$srcdir/pytest-subtests-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
cab486252148e457e234e0dadacefa5ff38cf67df48d9c8bd61aa546a4a1e712b70dca0a270dffceede6be0f8a6324e8c21beaa4d1528b39f12bba72e077ef1d  pytest-subtests-0.11.0.tar.gz
"
