|
36 | 36 | create_document_dataset, |
37 | 37 | create_image_dataset, |
38 | 38 | ) |
| 39 | +from tests.utils.http_server import check_port_open, free_port # noqa: E402 |
| 40 | + |
39 | 41 | try: |
40 | 42 | from tests.integration.feature_repos.integration_test_repo_config import ( # noqa: E402 |
41 | 43 | IntegrationTestRepoConfig, |
|
72 | 74 | customer = None # type: ignore[assignment] |
73 | 75 | driver = None # type: ignore[assignment] |
74 | 76 | location = None # type: ignore[assignment] |
| 77 | + |
75 | 78 | try: |
76 | 79 | from tests.utils.auth_permissions_util import default_store |
77 | 80 | except ModuleNotFoundError: |
78 | 81 | default_store = None # type: ignore[assignment] |
79 | | -from tests.utils.http_server import check_port_open, free_port # noqa: E402 |
| 82 | + |
80 | 83 | try: |
81 | 84 | from tests.utils.ssl_certifcates_util import ( |
82 | 85 | combine_trust_stores, |
@@ -262,14 +265,35 @@ def pytest_generate_tests(metafunc: pytest.Metafunc): |
262 | 265 |
|
263 | 266 | See more examples at https://docs.pytest.org/en/6.2.x/example/parametrize.html#paramexamples |
264 | 267 |
|
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, |
266 | 269 | when we call metafunc.parametrize("environment", ..., indirect=True) we actually |
267 | 270 | 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. |
269 | 272 | In order for pytest to group tests together (and share environment fixture) |
270 | 273 | parameter should point to the same Python object (hence, we use _config_cache dict to store those objects). |
271 | 274 | """ |
272 | 275 | 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 |
273 | 297 | markers = {m.name: m for m in metafunc.definition.own_markers} |
274 | 298 | offline_stores = None |
275 | 299 | if "universal_offline_stores" in markers: |
|
0 commit comments