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

Skip retrieval_with_hpo notebook test when optuna is not installed #897

Merged
merged 3 commits into from
Nov 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/unit/tf/examples/test_usecase_retrieval_with_hpo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import pytest
from testbook import testbook

from tests.conftest import REPO_ROOT

try:
import optuna # noqa: F401
except ImportError:
pytest.skip("No module named 'optuna'", allow_module_level=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be achieved with pytest.importorskip ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are equivalent. Changed to importorskip in 727f142.



@testbook(
REPO_ROOT / "examples/usecases/retrieval-with-hyperparameter-optimization.ipynb", execute=False
Expand Down