@@ -1036,8 +1036,7 @@ def test_use_schema(run_trino):
1036
1036
assert result [0 ][1 ] == 'sf1'
1037
1037
1038
1038
1039
- @pytest .mark .skipif (trino_version () == '351' , reason = "Newer Trino versions return the system role" )
1040
- def test_set_role_trino_higher_351 (run_trino ):
1039
+ def test_set_role (run_trino ):
1041
1040
_ , host , port = run_trino
1042
1041
1043
1042
trino_connection = trino .dbapi .Connection (
@@ -1050,24 +1049,11 @@ def test_set_role_trino_higher_351(run_trino):
1050
1049
1051
1050
cur .execute ("SET ROLE ALL" )
1052
1051
cur .fetchall ()
1053
- assert_role_headers (cur , "system=ALL" )
1054
-
1055
-
1056
- @pytest .mark .skipif (trino_version () != '351' , reason = "Trino 351 returns the role for the current catalog" )
1057
- def test_set_role_trino_351 (run_trino ):
1058
- _ , host , port = run_trino
1059
-
1060
- trino_connection = trino .dbapi .Connection (
1061
- host = host , port = port , user = "test" , catalog = "tpch"
1062
- )
1063
- cur = trino_connection .cursor ()
1064
- cur .execute ('SHOW TABLES FROM information_schema' )
1065
- cur .fetchall ()
1066
- assert cur ._request ._client_session .roles == {}
1067
-
1068
- cur .execute ("SET ROLE ALL" )
1069
- cur .fetchall ()
1070
- assert_role_headers (cur , "tpch=ALL" )
1052
+ if trino_version () == "351" :
1053
+ assert_role_headers (cur , "tpch=ALL" )
1054
+ else :
1055
+ # Newer Trino versions return the system role
1056
+ assert_role_headers (cur , "system=ALL" )
1071
1057
1072
1058
1073
1059
@pytest .mark .skipif (trino_version () == '351' , reason = "Newer Trino versions return the system role" )
0 commit comments