@@ -200,7 +200,7 @@ Loads environment variables specified in [`debug_env_name` fixture](#debug_env_n
200200for local debugging in IDEs, otherwise allowing the tests to run with the default environment variables
201201specified in the CI/CD pipeline.
202202
203- See also [ ` env_or_skip ` ] ( #env_or_skip-fixture ) , [ ` ws ` ] ( #ws-fixture ) , [ ` debug_env_name ` ] ( #debug_env_name-fixture ) , [ ` is_in_debug ` ] ( #is_in_debug-fixture ) .
203+ See also [ ` acc ` ] ( #acc-fixture ) , [ ` env_or_skip ` ] ( #env_or_skip-fixture ) , [ ` ws ` ] ( #ws-fixture ) , [ ` debug_env_name ` ] ( #debug_env_name-fixture ) , [ ` is_in_debug ` ] ( #is_in_debug-fixture ) .
204204
205205
206206[[ back to top] ( #python-testing-for-databricks )]
@@ -219,7 +219,7 @@ def test_something(env_or_skip):
219219 assert token is not None
220220```
221221
222- See also [ ` make_udf ` ] ( #make_udf-fixture ) , [ ` sql_backend ` ] ( #sql_backend-fixture ) , [ ` debug_env ` ] ( #debug_env-fixture ) , [ ` is_in_debug ` ] ( #is_in_debug-fixture ) .
222+ See also [ ` acc ` ] ( #acc-fixture ) , [ ` make_udf ` ] ( #make_udf-fixture ) , [ ` sql_backend ` ] ( #sql_backend-fixture ) , [ ` debug_env ` ] ( #debug_env-fixture ) , [ ` is_in_debug ` ] ( #is_in_debug-fixture ) .
223223
224224
225225[[ back to top] ( #python-testing-for-databricks )]
@@ -245,6 +245,33 @@ def test_workspace_operations(ws):
245245See also [`log_workspace_link`](#log_workspace_link-fixture), [`make_alert_permissions`](#make_alert_permissions-fixture), [`make_authorization_permissions`](#make_authorization_permissions-fixture), [`make_catalog`](#make_catalog-fixture), [`make_cluster`](#make_cluster-fixture), [`make_cluster_permissions`](#make_cluster_permissions-fixture), [`make_cluster_policy`](#make_cluster_policy-fixture), [`make_cluster_policy_permissions`](#make_cluster_policy_permissions-fixture), [`make_dashboard_permissions`](#make_dashboard_permissions-fixture), [`make_directory`](#make_directory-fixture), [`make_directory_permissions`](#make_directory_permissions-fixture), [`make_experiment`](#make_experiment-fixture), [`make_experiment_permissions`](#make_experiment_permissions-fixture), [`make_feature_table_permissions`](#make_feature_table_permissions-fixture), [`make_group`](#make_group-fixture), [`make_instance_pool`](#make_instance_pool-fixture), [`make_instance_pool_permissions`](#make_instance_pool_permissions-fixture), [`make_job`](#make_job-fixture), [`make_job_permissions`](#make_job_permissions-fixture), [`make_lakeview_dashboard_permissions`](#make_lakeview_dashboard_permissions-fixture), [`make_model`](#make_model-fixture), [`make_notebook`](#make_notebook-fixture), [`make_notebook_permissions`](#make_notebook_permissions-fixture), [`make_pipeline`](#make_pipeline-fixture), [`make_pipeline_permissions`](#make_pipeline_permissions-fixture), [`make_query`](#make_query-fixture), [`make_query_permissions`](#make_query_permissions-fixture), [`make_registered_model_permissions`](#make_registered_model_permissions-fixture), [`make_repo`](#make_repo-fixture), [`make_repo_permissions`](#make_repo_permissions-fixture), [`make_secret_scope`](#make_secret_scope-fixture), [`make_secret_scope_acl`](#make_secret_scope_acl-fixture), [`make_serving_endpoint`](#make_serving_endpoint-fixture), [`make_serving_endpoint_permissions`](#make_serving_endpoint_permissions-fixture), [`make_storage_credential`](#make_storage_credential-fixture), [`make_udf`](#make_udf-fixture), [`make_user`](#make_user-fixture), [`make_warehouse`](#make_warehouse-fixture), [`make_warehouse_permissions`](#make_warehouse_permissions-fixture), [`make_workspace_file_path_permissions`](#make_workspace_file_path_permissions-fixture), [`make_workspace_file_permissions`](#make_workspace_file_permissions-fixture), [`spark`](#spark-fixture), [`sql_backend`](#sql_backend-fixture), [`debug_env`](#debug_env-fixture), [`product_info`](#product_info-fixture).
246246
247247
248+ [[ back to top] ( #python-testing-for-databricks )]
249+
250+ ### ` acc ` fixture
251+ Create and provide a Databricks AccountClient object.
252+
253+ This fixture initializes a Databricks AccountClient object, which can be used
254+ to interact with the Databricks account API. The created instance of AccountClient
255+ is shared across all test functions within the test session.
256+
257+ Requires ` DATABRICKS_ACCOUNT_ID ` environment variable to be set. If ` DATABRICKS_HOST `
258+ points to a workspace host, the fixture would automatically determine the account host
259+ from it.
260+
261+ See [ detailed documentation] ( https://databricks-sdk-py.readthedocs.io/en/latest/authentication.html ) for the list
262+ of environment variables that can be used to authenticate the AccountClient.
263+
264+ In your test functions, include this fixture as an argument to use the AccountClient:
265+
266+ ``` python
267+ def test_listing_workspaces (acc ):
268+ workspaces = acc.workspaces.list()
269+ assert len (workspaces) >= 1
270+ ```
271+
272+ See also [ ` make_acc_group ` ] ( #make_acc_group-fixture ) , [ ` debug_env ` ] ( #debug_env-fixture ) , [ ` product_info ` ] ( #product_info-fixture ) , [ ` env_or_skip ` ] ( #env_or_skip-fixture ) .
273+
274+
248275[[ back to top] ( #python-testing-for-databricks )]
249276
250277### ` spark ` fixture
@@ -309,7 +336,7 @@ random_string = make_random(k=8)
309336assert len (random_string) == 8
310337```
311338
312- See also [ ` make_catalog ` ] ( #make_catalog-fixture ) , [ ` make_cluster ` ] ( #make_cluster-fixture ) , [ ` make_cluster_policy ` ] ( #make_cluster_policy-fixture ) , [ ` make_directory ` ] ( #make_directory-fixture ) , [ ` make_experiment ` ] ( #make_experiment-fixture ) , [ ` make_group ` ] ( #make_group-fixture ) , [ ` make_instance_pool ` ] ( #make_instance_pool-fixture ) , [ ` make_job ` ] ( #make_job-fixture ) , [ ` make_model ` ] ( #make_model-fixture ) , [ ` make_notebook ` ] ( #make_notebook-fixture ) , [ ` make_pipeline ` ] ( #make_pipeline-fixture ) , [ ` make_query ` ] ( #make_query-fixture ) , [ ` make_repo ` ] ( #make_repo-fixture ) , [ ` make_schema ` ] ( #make_schema-fixture ) , [ ` make_secret_scope ` ] ( #make_secret_scope-fixture ) , [ ` make_serving_endpoint ` ] ( #make_serving_endpoint-fixture ) , [ ` make_table ` ] ( #make_table-fixture ) , [ ` make_udf ` ] ( #make_udf-fixture ) , [ ` make_user ` ] ( #make_user-fixture ) , [ ` make_warehouse ` ] ( #make_warehouse-fixture ) .
339+ See also [ ` make_acc_group ` ] ( #make_acc_group-fixture ) , [ ` make_catalog ` ] ( #make_catalog-fixture ) , [ ` make_cluster ` ] ( #make_cluster-fixture ) , [ ` make_cluster_policy ` ] ( #make_cluster_policy-fixture ) , [ ` make_directory ` ] ( #make_directory-fixture ) , [ ` make_experiment ` ] ( #make_experiment-fixture ) , [ ` make_group ` ] ( #make_group-fixture ) , [ ` make_instance_pool ` ] ( #make_instance_pool-fixture ) , [ ` make_job ` ] ( #make_job-fixture ) , [ ` make_model ` ] ( #make_model-fixture ) , [ ` make_notebook ` ] ( #make_notebook-fixture ) , [ ` make_pipeline ` ] ( #make_pipeline-fixture ) , [ ` make_query ` ] ( #make_query-fixture ) , [ ` make_repo ` ] ( #make_repo-fixture ) , [ ` make_schema ` ] ( #make_schema-fixture ) , [ ` make_secret_scope ` ] ( #make_secret_scope-fixture ) , [ ` make_serving_endpoint ` ] ( #make_serving_endpoint-fixture ) , [ ` make_table ` ] ( #make_table-fixture ) , [ ` make_udf ` ] ( #make_udf-fixture ) , [ ` make_user ` ] ( #make_user-fixture ) , [ ` make_warehouse ` ] ( #make_warehouse-fixture ) .
313340
314341
315342[[ back to top] ( #python-testing-for-databricks )]
@@ -504,6 +531,26 @@ def test_new_group(make_group, make_user, ws):
504531See also [ ` ws ` ] ( #ws-fixture ) , [ ` make_random ` ] ( #make_random-fixture ) , [ ` watchdog_purge_suffix ` ] ( #watchdog_purge_suffix-fixture ) .
505532
506533
534+ [[ back to top] ( #python-testing-for-databricks )]
535+
536+ ### ` make_acc_group ` fixture
537+ This fixture provides a function to manage Databricks account groups. Groups can be created with
538+ specified members and roles, and they will be deleted after the test is complete.
539+
540+ Has the same arguments and behavior as [ ` make_group ` fixture] ( #make_group-fixture ) but uses the account
541+ client instead of the workspace client.
542+
543+ Example usage:
544+ ``` python
545+ def test_new_account_group (make_acc_group , acc ):
546+ group = make_acc_group()
547+ loaded = acc.groups.get(group.id)
548+ assert group.display_name == loaded.display_name
549+ ```
550+
551+ See also [ ` acc ` ] ( #acc-fixture ) , [ ` make_random ` ] ( #make_random-fixture ) , [ ` watchdog_purge_suffix ` ] ( #watchdog_purge_suffix-fixture ) .
552+
553+
507554[[ back to top] ( #python-testing-for-databricks )]
508555
509556### ` make_user ` fixture
@@ -819,7 +866,7 @@ See also [`ws`](#ws-fixture).
819866### ` product_info ` fixture
820867_ No description yet._
821868
822- See also [ ` ws ` ] ( #ws-fixture ) .
869+ See also [ ` acc ` ] ( #acc-fixture ) , [ ` ws ` ] ( #ws-fixture ) .
823870
824871
825872[[ back to top] ( #python-testing-for-databricks )]
@@ -1020,13 +1067,16 @@ See also [`make_cluster`](#make_cluster-fixture), [`make_instance_pool`](#make_i
10201067### ` watchdog_purge_suffix ` fixture
10211068HEX-encoded purge time suffix for test objects.
10221069
1023- See also [ ` make_cluster_policy ` ] ( #make_cluster_policy-fixture ) , [ ` make_directory ` ] ( #make_directory-fixture ) , [ ` make_experiment ` ] ( #make_experiment-fixture ) , [ ` make_group ` ] ( #make_group-fixture ) , [ ` make_notebook ` ] ( #make_notebook-fixture ) , [ ` make_pipeline ` ] ( #make_pipeline-fixture ) , [ ` make_query ` ] ( #make_query-fixture ) , [ ` make_repo ` ] ( #make_repo-fixture ) , [ ` make_user ` ] ( #make_user-fixture ) , [ ` watchdog_remove_after ` ] ( #watchdog_remove_after-fixture ) .
1070+ See also [ ` make_acc_group ` ] ( #make_acc_group-fixture ) , [ ` make_cluster_policy ` ] ( #make_cluster_policy-fixture ) , [ ` make_directory ` ] ( #make_directory-fixture ) , [ ` make_experiment ` ] ( #make_experiment-fixture ) , [ ` make_group ` ] ( #make_group-fixture ) , [ ` make_notebook ` ] ( #make_notebook-fixture ) , [ ` make_pipeline ` ] ( #make_pipeline-fixture ) , [ ` make_query ` ] ( #make_query-fixture ) , [ ` make_repo ` ] ( #make_repo-fixture ) , [ ` make_user ` ] ( #make_user-fixture ) , [ ` watchdog_remove_after ` ] ( #watchdog_remove_after-fixture ) .
10241071
10251072
10261073[[ back to top] ( #python-testing-for-databricks )]
10271074
10281075### ` is_in_debug ` fixture
1029- _ No description yet._
1076+ Returns true if the test is running from a debugger in IDE, otherwise false.
1077+
1078+ The following IDE are supported: IntelliJ IDEA (including Community Edition),
1079+ PyCharm (including Community Edition), and Visual Studio Code.
10301080
10311081See also [ ` debug_env ` ] ( #debug_env-fixture ) , [ ` env_or_skip ` ] ( #env_or_skip-fixture ) .
10321082
0 commit comments