File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1660,14 +1660,19 @@ def test_run_on_dataset_with_missing_labels_array(self):
16601660 assert len (row ) == 12
16611661
16621662 @pytest .mark .test_server ()
1663- def test_get_cached_run (self ):
1663+ @mock .patch .object (requests .Session , "request" )
1664+ def test_get_cached_run (self , mock_request ):
16641665 openml .config .set_root_cache_directory (self .static_cache_dir )
1665- openml .runs .functions ._get_cached_run (1 )
1666+ mock_request .side_effect = Exception ("Mocked Exception" )
1667+ openml .runs .get_run (1 )
16661668
1667- def test_get_uncached_run (self ):
1669+ @pytest .mark .test_server ()
1670+ @mock .patch .object (requests .Session , "request" )
1671+ def test_get_uncached_run (self , mock_request ):
16681672 openml .config .set_root_cache_directory (self .static_cache_dir )
1669- with pytest .raises (openml .exceptions .OpenMLCacheException ):
1670- openml .runs .functions ._get_cached_run (10 )
1673+ mock_request .side_effect = Exception ("Mocked Exception" )
1674+ with pytest .raises (Exception , match = "Mocked Exception" ):
1675+ openml .runs .get_run (10 )
16711676
16721677 @pytest .mark .sklearn ()
16731678 @pytest .mark .test_server ()
You can’t perform that action at this time.
0 commit comments