Skip to content

Commit ca3a25f

Browse files
authored
Fix bugs by using live server due to reduced volatility (#698)
* fix bugs, use live server due to reduced volatility * use older scipy version for older sklearn version * fix bash syntax error * add --yes to conda install * Remove print statement
1 parent 4257c48 commit ca3a25f

4 files changed

Lines changed: 17 additions & 10 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
# Checks for older scikit-learn versions (which also don't nicely work with
2323
# Python3.7)
2424
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.19.2"
25-
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.18.2"
25+
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.18.2" SCIPY_VERSION=1.2.0
2626

2727
# Travis issue
2828
# https://github.com/travis-ci/travis-ci/issues/8920

ci_scripts/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ popd
2727
conda create -n testenv --yes python=$PYTHON_VERSION pip
2828
source activate testenv
2929

30+
if [[ -v SCIPY_VERSION ]]; then
31+
conda install --yes scipy=$SCIPY_VERSION
32+
fi
33+
3034
python --version
3135
pip install -e '.[test]'
3236
python -c "import numpy; print('numpy %s' % numpy.__version__)"

tests/test_datasets/test_dataset_functions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,13 @@ def test__name_to_id_with_deactivated(self):
254254

255255
def test__name_to_id_with_multiple_active(self):
256256
""" With multiple active datasets, retrieve the least recent active. """
257-
self.assertEqual(openml.datasets.functions._name_to_id('iris'), 128)
257+
openml.config.server = self.production_server
258+
self.assertEqual(openml.datasets.functions._name_to_id('iris'), 61)
258259

259260
def test__name_to_id_with_version(self):
260261
""" With multiple active datasets, retrieve the least recent active. """
261-
self.assertEqual(openml.datasets.functions._name_to_id('iris', version=3), 151)
262+
openml.config.server = self.production_server
263+
self.assertEqual(openml.datasets.functions._name_to_id('iris', version=3), 969)
262264

263265
def test__name_to_id_with_multiple_active_error(self):
264266
""" With multiple active datasets, retrieve the least recent active. """

tests/test_setups/test_setup_functions.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,22 @@ def test_list_setups_empty(self):
138138
self.assertIsInstance(setups, dict)
139139

140140
def test_list_setups_output_format(self):
141-
flow_id = 18
142-
setups = openml.setups.list_setups(flow=flow_id, output_format='object')
141+
openml.config.server = self.production_server
142+
flow_id = 6794
143+
setups = openml.setups.list_setups(flow=flow_id, output_format='object', size=10)
143144
self.assertIsInstance(setups, Dict)
144145
self.assertIsInstance(setups[list(setups.keys())[0]],
145146
openml.setups.setup.OpenMLSetup)
146-
self.assertGreater(len(setups), 0)
147+
self.assertEqual(len(setups), 10)
147148

148-
setups = openml.setups.list_setups(flow=flow_id, output_format='dataframe')
149+
setups = openml.setups.list_setups(flow=flow_id, output_format='dataframe', size=10)
149150
self.assertIsInstance(setups, pd.DataFrame)
150-
self.assertGreater(len(setups), 0)
151+
self.assertEqual(len(setups), 10)
151152

152-
setups = openml.setups.list_setups(flow=flow_id, output_format='dict')
153+
setups = openml.setups.list_setups(flow=flow_id, output_format='dict', size=10)
153154
self.assertIsInstance(setups, Dict)
154155
self.assertIsInstance(setups[list(setups.keys())[0]], Dict)
155-
self.assertGreater(len(setups), 0)
156+
self.assertEqual(len(setups), 10)
156157

157158
def test_setuplist_offset(self):
158159
# TODO: remove after pull on live for better testing

0 commit comments

Comments
 (0)