Skip to content

Commit 369e4f5

Browse files
committed
fix: make pytest config compatible with newer pytest
Signed-off-by: amiraifori <iforiamira@gmail.com> Signed-off-by: antznette1 <ochiezeanthonette@gmail.com> Signed-off-by: Anthonette Adanyin <106275232+antznette1@users.noreply.github.com>
1 parent e022bf8 commit 369e4f5

2 files changed

Lines changed: 53 additions & 30 deletions

File tree

sdk/python/pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ env =
1010
IS_TEST=True
1111

1212
filterwarnings =
13-
error::_pytest.warning_types.PytestConfigWarning
14-
error::_pytest.warning_types.PytestUnhandledCoroutineWarning
13+
error::pytest.PytestConfigWarning
14+
error:.*was never awaited.*:RuntimeWarning
1515
ignore::DeprecationWarning:pyspark.sql.pandas.*:
1616
ignore::DeprecationWarning:pyspark.sql.connect.*:
1717
ignore::DeprecationWarning:httpx.*:

sdk/python/tests/conftest.py

Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,57 @@
3636
create_document_dataset,
3737
create_image_dataset,
3838
)
39-
from tests.integration.feature_repos.integration_test_repo_config import ( # noqa: E402
40-
IntegrationTestRepoConfig,
41-
)
42-
from tests.integration.feature_repos.repo_configuration import ( # noqa: E402
43-
AVAILABLE_OFFLINE_STORES,
44-
AVAILABLE_ONLINE_STORES,
45-
OFFLINE_STORE_TO_PROVIDER_CONFIG,
46-
Environment,
47-
TestData,
48-
construct_test_environment,
49-
construct_universal_feature_views,
50-
construct_universal_test_data,
51-
)
52-
from tests.integration.feature_repos.universal.data_sources.file import ( # noqa: E402
53-
FileDataSourceCreator,
54-
)
55-
from tests.integration.feature_repos.universal.entities import ( # noqa: E402
56-
customer,
57-
driver,
58-
location,
59-
)
60-
from tests.utils.auth_permissions_util import default_store
39+
try:
40+
from tests.integration.feature_repos.integration_test_repo_config import ( # noqa: E402
41+
IntegrationTestRepoConfig,
42+
)
43+
from tests.integration.feature_repos.repo_configuration import ( # noqa: E402
44+
AVAILABLE_OFFLINE_STORES,
45+
AVAILABLE_ONLINE_STORES,
46+
OFFLINE_STORE_TO_PROVIDER_CONFIG,
47+
Environment,
48+
TestData,
49+
construct_test_environment,
50+
construct_universal_feature_views,
51+
construct_universal_test_data,
52+
)
53+
from tests.integration.feature_repos.universal.data_sources.file import ( # noqa: E402
54+
FileDataSourceCreator,
55+
)
56+
from tests.integration.feature_repos.universal.entities import ( # noqa: E402
57+
customer,
58+
driver,
59+
location,
60+
)
61+
except ModuleNotFoundError:
62+
IntegrationTestRepoConfig = None # type: ignore[assignment]
63+
Environment = None # type: ignore[assignment]
64+
TestData = None # type: ignore[assignment]
65+
AVAILABLE_OFFLINE_STORES = None # type: ignore[assignment]
66+
AVAILABLE_ONLINE_STORES = None # type: ignore[assignment]
67+
OFFLINE_STORE_TO_PROVIDER_CONFIG = None # type: ignore[assignment]
68+
construct_test_environment = None # type: ignore[assignment]
69+
construct_universal_feature_views = None # type: ignore[assignment]
70+
construct_universal_test_data = None # type: ignore[assignment]
71+
FileDataSourceCreator = None # type: ignore[assignment]
72+
customer = None # type: ignore[assignment]
73+
driver = None # type: ignore[assignment]
74+
location = None # type: ignore[assignment]
75+
try:
76+
from tests.utils.auth_permissions_util import default_store
77+
except ModuleNotFoundError:
78+
default_store = None # type: ignore[assignment]
6179
from tests.utils.http_server import check_port_open, free_port # noqa: E402
62-
from tests.utils.ssl_certifcates_util import (
63-
combine_trust_stores,
64-
create_ca_trust_store,
65-
generate_self_signed_cert,
66-
)
80+
try:
81+
from tests.utils.ssl_certifcates_util import (
82+
combine_trust_stores,
83+
create_ca_trust_store,
84+
generate_self_signed_cert,
85+
)
86+
except ModuleNotFoundError:
87+
combine_trust_stores = None # type: ignore[assignment]
88+
create_ca_trust_store = None # type: ignore[assignment]
89+
generate_self_signed_cert = None # type: ignore[assignment]
6790

6891
logger = logging.getLogger(__name__)
6992

@@ -85,7 +108,7 @@
85108

86109

87110
def pytest_configure(config):
88-
if platform in ["darwin", "windows"]:
111+
if platform == "darwin" or platform.startswith("win"):
89112
multiprocessing.set_start_method("spawn", force=True)
90113
else:
91114
multiprocessing.set_start_method("fork")

0 commit comments

Comments
 (0)