File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,18 @@ async def test_exceptions_str(self):
3939 CREATE FUNCTION foo() RETURNS bool AS $$ $$ LANGUAGE SQL;
4040 ''' )
4141 except asyncpg .InvalidFunctionDefinitionError as e :
42- self .assertEqual (
43- e .detail ,
44- "Function's final statement must be SELECT or "
45- "INSERT/UPDATE/DELETE/MERGE RETURNING." )
46- self .assertIn (
47- 'DETAIL: Function' , str (e )
48- )
42+ if self .server_version < (17 , 0 ):
43+ detail = (
44+ "Function's final statement must be SELECT or "
45+ "INSERT/UPDATE/DELETE RETURNING."
46+ )
47+ else :
48+ detail = (
49+ "Function's final statement must be SELECT or "
50+ "INSERT/UPDATE/DELETE/MERGE RETURNING."
51+ )
52+
53+ self .assertEqual (e .detail , detail )
54+ self .assertIn ('DETAIL: Function' , str (e ))
4955 else :
5056 self .fail ('InvalidFunctionDefinitionError not raised' )
You can’t perform that action at this time.
0 commit comments