Skip to content

Commit 0bbd67d

Browse files
committed
style: better function name with overwrite_config_context
1 parent 2f02078 commit 0bbd67d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openml/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def set_root_cache_directory(root_cache_directory: str | Path) -> None:
499499

500500

501501
@contextmanager
502-
def set_context(config: dict[str, Any]) -> Iterator[_Config]:
502+
def overwrite_config_context(config: dict[str, Any]) -> Iterator[_Config]:
503503
"""A context manager to temporarily override variables in the configuration."""
504504
existing_config = get_config_as_dict()
505505
merged_config = {**existing_config, **config}

tests/test_openml/test_api_calls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ def test_authentication_endpoints_requiring_api_key_show_relevant_help_link(
120120
method: str,
121121
) -> None:
122122
# We need to temporarily disable the API key to test the error message
123-
with openml.config.set_context({"apikey": None}):
123+
with openml.config.overwrite_config_context({"apikey": None}):
124124
with pytest.raises(openml.exceptions.OpenMLNotAuthorizedError, match=API_TOKEN_HELP_LINK):
125125
openml._api_calls._perform_api_call(call=endpoint, request_method=method, data=None)

0 commit comments

Comments
 (0)