4141 OpenMLNotAuthorizedError ,
4242 OpenMLServerException ,
4343)
44- from openml ._api import api_context
4544from openml ._api .config import settings
4645#from openml.extensions.sklearn import cat, cont
4746from openml .runs .functions import (
@@ -1670,12 +1669,13 @@ def test_get_cached_run(self):
16701669 previous_cache_dir = settings .cache .dir
16711670 try :
16721671 settings .cache .dir = str (self .workdir / "http_cache_runs" )
1673- api_context .set_version ("v1" , strict = False )
1672+ openml ._backend .set_config_value ("api_version" , "v1" )
1673+ openml ._backend .set_config_value ("fallback_api_version" , "v1" )
16741674
16751675 run = openml .runs .get_run (1 )
16761676 assert run .run_id == 1
16771677
1678- http_client = api_context . backend . runs ._http
1678+ http_client = openml . _backend . run ._http
16791679 assert http_client .cache is not None
16801680
16811681 url = urljoin (
@@ -1690,18 +1690,20 @@ def test_get_cached_run(self):
16901690 assert (cache_path / "body.bin" ).exists ()
16911691 finally :
16921692 settings .cache .dir = previous_cache_dir
1693- api_context .set_version ("v1" , strict = False )
1693+ openml ._backend .set_config_value ("api_version" , "v1" )
1694+ openml ._backend .set_config_value ("fallback_api_version" , "v1" )
16941695
16951696 def test_get_uncached_run (self ):
16961697 previous_cache_dir = settings .cache .dir
16971698 try :
16981699 settings .cache .dir = str (self .workdir / "http_cache_runs_uncached" )
1699- api_context .set_version ("v1" , strict = False )
1700+ openml ._backend .set_config_value ("api_version" , "v1" )
1701+ openml ._backend .set_config_value ("fallback_api_version" , "v1" )
17001702
17011703 run = openml .runs .get_run (1 )
17021704 assert run .run_id == 1
17031705
1704- http_client = api_context . backend . runs ._http
1706+ http_client = openml . _backend . run ._http
17051707 assert http_client .cache is not None
17061708
17071709 url = urljoin (
@@ -1716,7 +1718,8 @@ def test_get_uncached_run(self):
17161718 assert (cache_path / "body.bin" ).exists ()
17171719 finally :
17181720 settings .cache .dir = previous_cache_dir
1719- api_context .set_version ("v1" , strict = False )
1721+ openml ._backend .set_config_value ("api_version" , "v1" )
1722+ openml ._backend .set_config_value ("fallback_api_version" , "v1" )
17201723
17211724 @pytest .mark .sklearn ()
17221725 @pytest .mark .uses_test_server ()
0 commit comments