iports/ilot/py3-testing-postgresql/44_replace-assert-regeexp-matches.patch
Antoine Martin 9d314e462d
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
ilot/py3-testing-postgresql: new aport
2024-09-19 12:52:31 -04:00

34 lines
1.4 KiB
Diff

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