Skip to content

Commit 2abd8be

Browse files
committed
Update conftest.py
Signed-off-by: Anthonette Adanyin <106275232+antznette1@users.noreply.github.com> Signed-off-by: antznette1 <Ochiezeanthonette@gmail.com>
1 parent 369e4f5 commit 2abd8be

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

sdk/python/tests/conftest.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
create_document_dataset,
3737
create_image_dataset,
3838
)
39+
from tests.utils.http_server import check_port_open, free_port # noqa: E402
40+
3941
try:
4042
from tests.integration.feature_repos.integration_test_repo_config import ( # noqa: E402
4143
IntegrationTestRepoConfig,
@@ -72,11 +74,12 @@
7274
customer = None # type: ignore[assignment]
7375
driver = None # type: ignore[assignment]
7476
location = None # type: ignore[assignment]
77+
7578
try:
7679
from tests.utils.auth_permissions_util import default_store
7780
except ModuleNotFoundError:
7881
default_store = None # type: ignore[assignment]
79-
from tests.utils.http_server import check_port_open, free_port # noqa: E402
82+
8083
try:
8184
from tests.utils.ssl_certifcates_util import (
8285
combine_trust_stores,
@@ -262,14 +265,35 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
262265
263266
See more examples at https://docs.pytest.org/en/6.2.x/example/parametrize.html#paramexamples
264267
265-
We also utilize indirect parametrization here. Since `environment` is a fixture,
268+
We also utilize indirect parametrization here. Since [environment](cci:1://file:///c:/Users/brass/OneDrive/Desktop/Work/App/Lanre/feast/sdk/python/tests/conftest.py:229:0-245:16) is a fixture,
266269
when we call metafunc.parametrize("environment", ..., indirect=True) we actually
267270
parametrizing this "environment" fixture and not the test itself.
268-
Moreover, by utilizing `_config_cache` we are able to share `environment` fixture between different tests.
271+
Moreover, by utilizing `_config_cache` we are able to share [environment](cci:1://file:///c:/Users/brass/OneDrive/Desktop/Work/App/Lanre/feast/sdk/python/tests/conftest.py:229:0-245:16) fixture between different tests.
269272
In order for pytest to group tests together (and share environment fixture)
270273
parameter should point to the same Python object (hence, we use _config_cache dict to store those objects).
271274
"""
272275
if "environment" in metafunc.fixturenames:
276+
if (
277+
IntegrationTestRepoConfig is None
278+
or AVAILABLE_OFFLINE_STORES is None
279+
or AVAILABLE_ONLINE_STORES is None
280+
or OFFLINE_STORE_TO_PROVIDER_CONFIG is None
281+
or FileDataSourceCreator is None
282+
):
283+
metafunc.parametrize(
284+
"environment",
285+
[
286+
pytest.param(
287+
None,
288+
marks=pytest.mark.skip(
289+
reason="Optional integration test dependencies are not installed"
290+
),
291+
)
292+
],
293+
indirect=True,
294+
ids=["missing_optional_integration_deps"],
295+
)
296+
return
273297
markers = {m.name: m for m in metafunc.definition.own_markers}
274298
offline_stores = None
275299
if "universal_offline_stores" in markers:

0 commit comments

Comments
 (0)