File tree 1 file changed +13
-7
lines changed
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):
39
39
CREATE FUNCTION foo() RETURNS bool AS $$ $$ LANGUAGE SQL;
40
40
''' )
41
41
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 ))
49
55
else :
50
56
self .fail ('InvalidFunctionDefinitionError not raised' )
You can’t perform that action at this time.
0 commit comments