summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMarcell Meszaros2022-04-06 19:37:18 +0200
committerMarcell Meszaros2022-04-06 20:46:06 +0200
commitf9010aea9dd4189d00d906cef04dfef2248f87ae (patch)
tree25ac56914dfc9592c2047d69799fb1bdbe7bda1d /PKGBUILD
parent4b7aeae80150a8cd2a2ae6fdf134da361a74f94d (diff)
downloadaur-python2-colorama-git.tar.gz
modernize test running
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD7
1 files changed, 6 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index fd9df710c5f4..a4fccd67bfcf 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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() {