Skip to content

Commit 40dd174

Browse files
committed
travis-ci: use API key
1 parent c1161a8 commit 40dd174

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/test_apiconnector.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,22 @@ def setUp(self):
4646
os.chdir(self.workdir)
4747

4848
self.cached = True
49-
self.connector = APIConnector(cache_directory=self.workdir)
5049
try:
5150
apikey = os.environ['OPENMLAPIKEY']
5251
except:
5352
apikey = None
5453

54+
try:
55+
travis = os.environ['TRAVIS']
56+
if apikey is None:
57+
raise Exception('Running on travis-ci, but no environment '
58+
'variable OPENMLAPIKEY found.')
59+
except:
60+
pass
61+
62+
self.connector = APIConnector(cache_directory=self.workdir,
63+
apikey=apikey)
64+
5565
def tearDown(self):
5666
os.chdir(self.cwd)
5767
shutil.rmtree(self.workdir)

0 commit comments

Comments
 (0)