The documentation for the ws fixture says:
This fixture initializes a Databricks WorkspaceClient object, which can be used to interact with the Databricks workspace API. The created instance of WorkspaceClient is shared across all test functions within the test session.
This is not true. The fixture uses the default "function" scope, see the pytest documentation:
function: the default scope, the fixture is destroyed at the end of the test.
This can be shown with a simple example:
def test_ws(ws):
print(id(ws))
def test_ws_2(ws):
print(id(ws))
When run with pytest --capture=no, we see two different object ids for the two instances created.
The documentation for the
wsfixture says:This is not true. The fixture uses the default "function" scope, see the pytest documentation:
This can be shown with a simple example:
When run with
pytest --capture=no, we see two different object ids for the two instances created.