Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset project as cleanup in empty_data_context #9909

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_project( # noqa: PLR0913
)
return self.__project

def set_project(self, project: AbstractDataContext) -> None:
def set_project(self, project: AbstractDataContext | None) -> None:
self.__project = project

@property
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def mysql_engine(test_backend):
@pytest.fixture(scope="function")
def empty_data_context(
tmp_path,
) -> FileDataContext:
) -> Generator[FileDataContext, None, None]:
project_path = tmp_path / "empty_data_context"
project_path.mkdir()
project_path = str(project_path)
Expand All @@ -733,7 +733,8 @@ def empty_data_context(
os.makedirs(asset_config_path, exist_ok=True) # noqa: PTH103
assert context.list_datasources() == []
project_manager.set_project(context)
return context
yield context
project_manager.set_project(None)


@pytest.fixture(scope="function")
Expand Down