ilot/py3-testing-postgresql: new aport
Some checks failed
/ lint (pull_request) Successful in 27s
/ deploy-x86_64 (pull_request) Has been skipped
/ build-x86_64 (pull_request) Failing after 46s
/ deploy-aarch64 (pull_request) Has been skipped
/ build-aarch64 (pull_request) Failing after 1m39s

This commit is contained in:
Antoine Martin 2024-09-19 12:52:31 -04:00
parent 23492e9b4d
commit 9d314e462d
Signed by: ayakael
GPG key ID: D62A472A4AA7D541
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,34 @@
From ec9ce743a0f51076d7ea2485a6fa58b72ec8e338 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Fri, 4 Aug 2023 10:58:08 -0400
Subject: [PATCH] Replace assertRegexpMatches() with assertRegex()
This alias was deprecated in Python 3.2 and is removed in Python 3.12.
Reference: https://docs.python.org/3.12/whatsnew/3.12.html
---
tests/test_postgresql.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py
index 1fa1116..b2bba20 100644
--- a/tests/test_postgresql.py
+++ b/tests/test_postgresql.py
@@ -28,7 +28,7 @@ def test_basic(self):
# connect to postgresql (w/ psycopg2)
conn = psycopg2.connect(**pgsql.dsn())
self.assertIsNotNone(conn)
- self.assertRegexpMatches(pgsql.read_bootlog(), 'is ready to accept connections')
+ self.assertRegex(pgsql.read_bootlog(), 'is ready to accept connections')
conn.close()
# connect to postgresql (w/ sqlalchemy)
@@ -38,7 +38,7 @@ def test_basic(self):
# connect to postgresql (w/ pg8000)
conn = pg8000.connect(**pgsql.dsn())
self.assertIsNotNone(conn)
- self.assertRegexpMatches(pgsql.read_bootlog(), 'is ready to accept connections')
+ self.assertRegex(pgsql.read_bootlog(), 'is ready to accept connections')
conn.close()
finally:
# shutting down

View file

@ -0,0 +1,42 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-testing-postgresql
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=testing.postgresql
pkgver=1.3.0
pkgrel=0
pkgdesc="Automatically setups a postgresql instance in a temporary directory, and destroys it after testing"
url="https://pypi.python.org/project/testing.postgresql"
arch="noarch"
license="Apache-2.0"
depends="py3-testing-common-database py3-pg8000 postgresql"
checkdepends="py3-pytest py3-psycopg2 py3-sqlalchemy"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="
$pkgname-$pkgver.tar.gz::https://github.com/tk0miya/testing.postgresql/archive/refs/tags/$pkgver.tar.gz
44_replace-assert-regeexp-matches.patch
"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"
build() {
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 -v
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
}
sha512sums="
7b907e4c11c67eb6a2e936e6b96fb90747dfe14d92b8864a3951071701da8888e583deec7d05d4c0bd145f4d7b03bd71434c2111116eccd9a001466021433720 py3-testing-postgresql-1.3.0.tar.gz
42a51e77c20daa98f981b58ae9c8efd422dda2d04e53497df61a4e500a2aff4fc6c58c5f298c796b5f8f180ec7625561373991eee0433b11a88c874775469d5a 44_replace-assert-regeexp-matches.patch
"