You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -75,7 +85,7 @@ also install it directly from the command line:
75
85
pip install databricks-labs-pytester
76
86
```
77
87
78
-
If you use `hatch` as a build system, make sure to add `databricks-labs-pytester` as
88
+
If you use `hatch` as a build system, make sure to add `databricks-labs-pytester` as
79
89
a test-time dependency and not as a compile-time dependency, otherwise your wheels will
80
90
transitively depend on `pytest`, which is not usually something you need.
81
91
@@ -97,7 +107,7 @@ dependencies = [
97
107
"pylint~=3.2.2",
98
108
"pylint-pytest==2.0.0a0",
99
109
"databricks-labs-pylint~=0.4.0",
100
-
"databricks-labs-pytester~=0.2", # <= this library
110
+
"databricks-labs-pytester~=0.2", # <= this library
101
111
"pytest~=8.3.3",
102
112
"pytest-cov~=4.1.0",
103
113
"pytest-mock~=3.14.0",
@@ -116,7 +126,7 @@ dependencies = [
116
126
117
127
Built on top of [Databricks SDK for Python](https://github.com/databricks/databricks-sdk-py), this library is part of the Databricks Labs Python ecosystem, which includes the following projects:
118
128
*[PyLint Plugin for Databricks](https://github.com/databrickslabs/pylint-plugin) for static code analysis and early bug detection.
119
-
*[Blueprint](https://github.com/databrickslabs/blueprint) for
129
+
*[Blueprint](https://github.com/databrickslabs/blueprint) for
[Managing Python App installations within Databricks Workspaces](https://github.com/databrickslabs/blueprint#application-and-installation-state),
122
132
[Application Migrations](https://github.com/databrickslabs/blueprint#application-state-migrations), and
@@ -130,18 +140,18 @@ See [this video](https://www.youtube.com/watch?v=CNypO79IATc) for a quick overvi
130
140
131
141
## PyTest Fixtures
132
142
133
-
[PyTest Fixtures](https://docs.pytest.org/en/latest/explanation/fixtures.html) are a powerful way to manage test setup and teardown in Python. This library provides
143
+
[PyTest Fixtures](https://docs.pytest.org/en/latest/explanation/fixtures.html) are a powerful way to manage test setup and teardown in Python. This library provides
134
144
a set of fixtures to help you write integration tests for Databricks. These fixtures were incubated
135
-
within the [Unity Catalog Automated Migrations project](https://github.com/databrickslabs/ucx/blame/df7f1d7647251fb8f0f23c56a548b99092484a7c/src/databricks/labs/ucx/mixins/fixtures.py)
145
+
within the [Unity Catalog Automated Migrations project](https://github.com/databrickslabs/ucx/blame/df7f1d7647251fb8f0f23c56a548b99092484a7c/src/databricks/labs/ucx/mixins/fixtures.py)
136
146
for more than a year and are now available for other projects to simplify integration testing with Databricks.
137
147
138
148
[[back to top](#python-testing-for-databricks)]
139
149
140
150
### Logging
141
151
142
-
This library is built on years of debugging integration tests for Databricks and its ecosystem.
152
+
This library is built on years of debugging integration tests for Databricks and its ecosystem.
143
153
144
-
That's why it comes with a built-in logger that traces creation and deletion of dummy entities through links in
154
+
That's why it comes with a built-in logger that traces creation and deletion of dummy entities through links in
145
155
the Databricks Workspace UI. If you run the following code:
through_query =next(run_as.sql_fetch_all("SELECT CURRENT_USER() AS my_name"))
320
+
me = ws.current_user.me()
321
+
assert me.user_name != through_query.my_name
322
+
```
323
+
324
+
See also [`acc`](#acc-fixture), [`ws`](#ws-fixture), [`make_random`](#make_random-fixture), [`env_or_skip`](#env_or_skip-fixture), [`log_account_link`](#log_account_link-fixture).
See also [`make_acc_group`](#make_acc_group-fixture), [`make_run_as`](#make_run_as-fixture), [`debug_env`](#debug_env-fixture), [`product_info`](#product_info-fixture), [`env_or_skip`](#env_or_skip-fixture).
351
+
See also [`log_account_link`](#log_account_link-fixture), [`make_acc_group`](#make_acc_group-fixture), [`make_run_as`](#make_run_as-fixture), [`debug_env`](#debug_env-fixture), [`product_info`](#product_info-fixture), [`env_or_skip`](#env_or_skip-fixture).
309
352
310
353
311
354
[[back to top](#python-testing-for-databricks)]
@@ -349,14 +392,6 @@ Fetch all rows from a SQL statement.
349
392
See also [`sql_backend`](#sql_backend-fixture).
350
393
351
394
352
-
[[back to top](#python-testing-for-databricks)]
353
-
354
-
### `make_run_as` fixture
355
-
_No description yet._
356
-
357
-
See also [`acc`](#acc-fixture), [`ws`](#ws-fixture), [`make_random`](#make_random-fixture), [`env_or_skip`](#env_or_skip-fixture).
358
-
359
-
360
395
[[back to top](#python-testing-for-databricks)]
361
396
362
397
### `make_random` fixture
@@ -1067,6 +1102,14 @@ rns a function to log a workspace link.
1067
1102
See also [`ws`](#ws-fixture).
1068
1103
1069
1104
1105
+
[[back to top](#python-testing-for-databricks)]
1106
+
1107
+
### `log_account_link` fixture
1108
+
rns a function to log an account link.
1109
+
1110
+
See also [`make_run_as`](#make_run_as-fixture), [`acc`](#acc-fixture).
1111
+
1112
+
1070
1113
[[back to top](#python-testing-for-databricks)]
1071
1114
1072
1115
### `make_dashboard_permissions` fixture
@@ -1208,11 +1251,11 @@ See also [`debug_env`](#debug_env-fixture), [`env_or_skip`](#env_or_skip-fixture
1208
1251
1209
1252
# Project Support
1210
1253
1211
-
Please note that this project is provided for your exploration only and is not
1212
-
formally supported by Databricks with Service Level Agreements (SLAs). They are
1213
-
provided AS-IS, and we do not make any guarantees of any kind. Please do not
1254
+
Please note that this project is provided for your exploration only and is not
1255
+
formally supported by Databricks with Service Level Agreements (SLAs). They are
1256
+
provided AS-IS, and we do not make any guarantees of any kind. Please do not
1214
1257
submit a support ticket relating to any issues arising from the use of this project.
1215
1258
1216
-
Any issues discovered through the use of this project should be filed as GitHub
1217
-
[Issues on this repository](https://github.com/databrickslabs/pytester/issues).
1259
+
Any issues discovered through the use of this project should be filed as GitHub
1260
+
[Issues on this repository](https://github.com/databrickslabs/pytester/issues).
1218
1261
They will be reviewed as time permits, but no formal SLAs for support exist.
0 commit comments