john-bodley commented on code in PR #28159: URL: https://github.com/apache/superset/pull/28159#discussion_r1573445650
########## tests/integration_tests/fixtures/public_role.py: ########## @@ -15,30 +15,29 @@ # specific language governing permissions and limitations # under the License. import pytest +from flask.ctx import AppContext from superset.extensions import db, security_manager from tests.integration_tests.test_app import app @pytest.fixture() -def public_role_like_gamma(): - with app.app_context(): - app.config["PUBLIC_ROLE_LIKE"] = "Gamma" - security_manager.sync_role_definitions() +def public_role_like_gamma(app_context: AppContext): Review Comment: Reuse existing fixture. ########## tests/integration_tests/fixtures/public_role.py: ########## @@ -15,30 +15,29 @@ # specific language governing permissions and limitations # under the License. import pytest +from flask.ctx import AppContext from superset.extensions import db, security_manager from tests.integration_tests.test_app import app @pytest.fixture() -def public_role_like_gamma(): - with app.app_context(): - app.config["PUBLIC_ROLE_LIKE"] = "Gamma" - security_manager.sync_role_definitions() +def public_role_like_gamma(app_context: AppContext): + app.config["PUBLIC_ROLE_LIKE"] = "Gamma" + security_manager.sync_role_definitions() - yield + yield - security_manager.get_public_role().permissions = [] - db.session.commit() + security_manager.get_public_role().permissions = [] + db.session.commit() @pytest.fixture() -def public_role_like_test_role(): - with app.app_context(): - app.config["PUBLIC_ROLE_LIKE"] = "TestRole" - security_manager.sync_role_definitions() +def public_role_like_test_role(app_context: AppContext): Review Comment: Reuse existing fixture. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org