# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-mock
pkgver=3.14.0
pkgrel=3
pkgdesc="Thin-wrapper around the mock package for easier use with py.test"
arch=('any')
license=('LGPL3')
url="https://github.com/pytest-dev/pytest-mock/"
depends=('python-pytest')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel'
             'python-setuptools-scm')
checkdepends=('python-pytest-asyncio')
source=("git+https://github.com/pytest-dev/pytest-mock.git#tag=v$pkgver")
sha512sums=('081693752c306ad7d8740a476f2f7bcc31393cccd45b0b2db8daa31972c685737d05048a9afcace9c3c918d8b0bd0333c6b9291033a3624f53584166bb3fe54e')

build() {
  cd pytest-mock
  python -m build -nw
}

check() {
  cd pytest-mock
  python -m venv tmpenv --system-site-packages
  tmpenv/bin/python -m installer dist/*.whl
  tmpenv/bin/python -m pytest
}

package() {
  cd pytest-mock
  python -m installer -d "$pkgdir" dist/*.whl
}
