-
-
Notifications
You must be signed in to change notification settings - Fork 272
Expand file tree
/
Copy pathtest_supervised_task.py
More file actions
35 lines (25 loc) · 844 Bytes
/
test_supervised_task.py
File metadata and controls
35 lines (25 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# License: BSD 3-Clause
from __future__ import annotations
import unittest
import pandas as pd
from openml.tasks import get_task
import pytest
from .test_task import OpenMLTaskTest
class OpenMLSupervisedTaskTest(OpenMLTaskTest):
"""
A helper class. The methods of the test case
are only executed in subclasses of the test case.
"""
__test__ = False
@classmethod
def setUpClass(cls):
if cls is OpenMLSupervisedTaskTest:
raise unittest.SkipTest("Skip OpenMLSupervisedTaskTest tests," " it's a base class")
super().setUpClass()
def setUp(self, n_levels: int = 1):
super().setUp()
@pytest.mark.test_server()
def test_get_X_and_Y(self) -> tuple[pd.DataFrame, pd.Series]:
task = get_task(self.task_id)
X, Y = task.get_X_and_y()
return X, Y