@@ -94,23 +94,21 @@ def contains_select_on_any_file(grants: Iterable[Grant]) -> bool:
94
94
95
95
96
96
@retried (on = [NotFound , TimeoutError ], timeout = dt .timedelta (minutes = 3 ))
97
- def test_grant_findings (
98
- runtime_ctx : MockRuntimeContext , sql_backend : StatementExecutionBackend , _deployed_schema : None
99
- ) -> None :
97
+ def test_grant_findings (runtime_ctx : MockRuntimeContext , _deployed_schema : None ) -> None :
100
98
"""Test that findings are reported for a grant."""
101
99
102
100
# Fixture: two objects, one with a grant that is okay and the other with a grant that is not okay.
103
101
group = runtime_ctx .make_group ()
104
102
schema = runtime_ctx .make_schema ()
105
103
table_a = runtime_ctx .make_table (schema_name = schema .name )
106
104
table_b = runtime_ctx .make_table (schema_name = schema .name )
107
- sql_backend .execute (f"GRANT SELECT ON TABLE { table_a .full_name } TO `{ group .display_name } `" )
108
- sql_backend .execute (f"DENY SELECT ON TABLE { table_b .full_name } TO `{ group .display_name } `" )
105
+ runtime_ctx . sql_backend .execute (f"GRANT SELECT ON TABLE { table_a .full_name } TO `{ group .display_name } `" )
106
+ runtime_ctx . sql_backend .execute (f"DENY SELECT ON TABLE { table_b .full_name } TO `{ group .display_name } `" )
109
107
110
108
# Ensure the view is populated (it's based on the crawled grants) and fetch the content.
111
109
GrantsCrawler (runtime_ctx .tables_crawler , runtime_ctx .udfs_crawler ).snapshot ()
112
110
113
- rows = sql_backend .fetch (
111
+ rows = runtime_ctx . sql_backend .fetch (
114
112
f"""
115
113
SELECT object_type, object_id, success, failures
116
114
FROM { runtime_ctx .inventory_database } .grant_detail
0 commit comments