@@ -84,9 +84,9 @@ def assert_version_matches(self, expected_version: str):
8484 AssertionError: If the installed version does not match the expected version
8585 """
8686 installed_version = self .get_installed_version ()
87- assert (
88- installed_version == expected_version
89- ), f"Expected version { expected_version } , but found { installed_version } "
87+ assert installed_version == expected_version , (
88+ f"Expected version { expected_version } , but found { installed_version } "
89+ )
9090
9191 def check_upgrade_path (self , pg_version : str ):
9292 """Test the complete upgrade path for a PostgreSQL version.
@@ -172,37 +172,6 @@ def check_switch_extension_with_background_worker(
172172 self .vm .succeed (f"switch_{ self .extension_name } _version { last_version } " )
173173 # Check that we are using the last version now
174174 ext_version = self .vm .succeed (f"readlink -f { extension_lib_path } " ).strip ()
175- assert ext_version .endswith (
176- f"{ last_version } .so"
177- ), f"Expected { self .extension_name } version { last_version } , but found { ext_version } "
178-
179- def check_pg_regress (self , pg_regress : Path , pg_version : str , test_name : str ):
180- """Run pg_regress tests for the extension on a given PostgreSQL version.
181-
182- Args:
183- pg_regress: Path to the pg_regress binary
184- pg_version: PostgreSQL version to test (e.g., "14", "15")
185- test_name: SQL test file to run with pg_regress
186- """
187- sql_file = self .sql_test_dir / "sql" / f"{ test_name } .sql"
188- if not sql_file .exists ():
189- # check if we have a postgres version specific sql file
190- test_name = f"z_{ pg_version } _{ test_name } "
191- sql_file = self .sql_test_dir / "sql" / f"{ test_name } .sql"
192- if not sql_file .exists ():
193- print (f"Skipping pg_regress test for { pg_version } , no sql file found" )
194- return
195- try :
196- print (
197- self .vm .succeed (
198- f"""sudo -u postgres { pg_regress } --inputdir={ self .sql_test_dir } --debug --use-existing --dbname=postgres --outputdir=/tmp/regression_output_{ pg_version } "{ test_name } " """
199- )
200- )
201- except :
202- print ("Error running pg_regress, diff:" )
203- print (
204- self .vm .succeed (
205- f"cat /tmp/regression_output_{ pg_version } /regression.diffs"
206- )
207- )
208- raise
175+ assert ext_version .endswith (f"{ self .extension_name } -{ last_version } .so" ), (
176+ f"Expected { self .extension_name } version { last_version } , but found { ext_version } "
177+ )
0 commit comments