From ec9ce743a0f51076d7ea2485a6fa58b72ec8e338 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" 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