Skip to content

Commit

Permalink
Fix test failure: test_workspace_object_crawler (#2677)
Browse files Browse the repository at this point in the history
## 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`
  • Loading branch information
JCZuurmond authored Sep 19, 2024
1 parent 9d4724f commit d431967
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/integration/assessment/test_assessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d431967

Please sign in to comment.