diff options
author | Marcell Meszaros | 2022-04-06 19:37:18 +0200 |
---|---|---|
committer | Marcell Meszaros | 2022-04-06 20:46:06 +0200 |
commit | f9010aea9dd4189d00d906cef04dfef2248f87ae (patch) | |
tree | 25ac56914dfc9592c2047d69799fb1bdbe7bda1d /PKGBUILD | |
parent | 4b7aeae80150a8cd2a2ae6fdf134da361a74f94d (diff) | |
download | aur-python2-colorama-git.tar.gz |
modernize test running
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -25,6 +25,11 @@ prepare() { sed -r -i 's_^#!.*/usr/bin/python(\s|$)_#!/usr/bin/python2_' "${file}" sed -r -i 's_^#!.*/usr/bin/env(\s)*python(\s|$)_#!/usr/bin/env python2_' "${file}" done + + # Patch tests that want to import Python3's unittest.mock instead of Python2's test.mock + find . -name '*_test.py' -print | while read file; do + sed -r -i 's|unittest.mock|test._mock_backport|g' "${file}" + done } pkgver() { @@ -55,7 +60,7 @@ build() { check() { cd "${_gitname}" - python2 setup.py test --verbose + python2 -m unittest discover --verbose --pattern '*_test.py' || echo "Tests failed" } package() { |