From d431967c886b0ccf28bf23193211a760c569b7f1 Mon Sep 17 00:00:00 2001 From: Cor Date: Thu, 19 Sep 2024 14:37:38 +0200 Subject: [PATCH] Fix test failure: `test_workspace_object_crawler` (#2677) ## Changes [Pytester](https://github.com/databrickslabs/pytester) adopted return type `WorkspacePath` for `make_notebook` Changes for `make_notebook` fixture applied in this PR ### Linked issues Resolves #2670 ### Tests - [x] changed integration tests `test_workspace_object_crawler` --- tests/integration/assessment/test_assessment.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/integration/assessment/test_assessment.py b/tests/integration/assessment/test_assessment.py index a5b8527022..82e05c16fb 100644 --- a/tests/integration/assessment/test_assessment.py +++ b/tests/integration/assessment/test_assessment.py @@ -40,10 +40,16 @@ @retried(on=[NotFound], timeout=timedelta(minutes=5)) -def test_workspace_object_crawler(ws, make_notebook, inventory_schema, sql_backend): +def test_workspace_object_crawler(ws, make_notebook, inventory_schema, sql_backend) -> None: notebook = make_notebook() - workspace_listing = WorkspaceListing(ws, sql_backend, inventory_schema) - workspace_objects = {_.path: _ for _ in workspace_listing.snapshot()} - assert notebook in workspace_objects - assert workspace_objects[notebook].object_type == "NOTEBOOK" + workspace_listing = WorkspaceListing( + ws, + sql_backend, + inventory_schema, + start_path=str(notebook.parent), + ) + + workspace_objects = {_.path: _ for _ in workspace_listing.snapshot()} + assert str(notebook) in workspace_objects + assert workspace_objects[str(notebook)].object_type == "NOTEBOOK"