Skip to content

Commit 4ab1364

Browse files
committed
Move test for config file to beginning of setup
1 parent db372da commit 4ab1364

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/test_apiconnector.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ class TestAPIConnector(unittest.TestCase):
2828
"""
2929

3030
def setUp(self):
31+
config_file = os.path.expanduser('~/.openml/config')
32+
if not os.path.exists(config_file):
33+
raise Exception("OpenML config file required to run unit tests. "
34+
"See https://github.com/openml/OpenML/wiki/Client-API")
35+
3136
self.cwd = os.getcwd()
3237
workdir = os.path.dirname(os.path.abspath(__file__))
3338
self.workdir = os.path.join(workdir, "tmp")
@@ -43,11 +48,6 @@ def setUp(self):
4348
self.connector = APIConnector(cache_directory=self.workdir)
4449
print(self.connector._session_hash)
4550

46-
config_file = os.path.expanduser('~/.openml/config')
47-
if not os.path.exists(config_file):
48-
raise Exception("OpenML config file required to run unit tests. "
49-
"See https://github.com/openml/OpenML/wiki/Client-API")
50-
5151
def tearDown(self):
5252
os.chdir(self.cwd)
5353
shutil.rmtree(self.workdir)

0 commit comments

Comments
 (0)