-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test (typing): Add tests for typing.
Add tests for the typing module.
- Loading branch information
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Test directory for the typing module.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
"""The test suite for the typing module. | ||
As the typing module only contains types, the tests only check imports. | ||
""" | ||
# ruff: noqa: F401 | ||
|
||
import pytest | ||
|
||
|
||
def test_analysis_types() -> None: | ||
"""Test the analysis types.""" | ||
try: | ||
from stimulus.typing import Analysis, AnalysisPerformanceTune, AnalysisRobustness | ||
except ImportError: | ||
pytest.fail("Failed to import Analysis types") | ||
|
||
|
||
def test_data_handlers_types() -> None: | ||
"""Test the data handlers types.""" | ||
try: | ||
from stimulus.typing import ( | ||
DatasetHandler, | ||
DatasetLoader, | ||
DatasetManager, | ||
DatasetProcessor, | ||
EncodeManager, | ||
SplitManager, | ||
TransformManager, | ||
) | ||
except ImportError: | ||
pytest.fail("Failed to import Data Handlers types") | ||
|
||
|
||
def test_learner_types() -> None: | ||
"""Test the learner types.""" | ||
try: | ||
from stimulus.typing import ( | ||
PredictWrapper, | ||
RayTuneMetrics, | ||
RayTuneOptimizer, | ||
RayTuneResult, | ||
TuneModel, | ||
TuneParser, | ||
TuneWrapper, | ||
) | ||
except ImportError: | ||
pytest.fail("Failed to import Learner types") | ||
|
||
|
||
def test_yaml_data_types() -> None: | ||
"""Test the YAML data types.""" | ||
try: | ||
from stimulus.typing import ( | ||
YamlColumns, | ||
YamlColumnsEncoder, | ||
YamlConfigDict, | ||
YamlGlobalParams, | ||
YamlSchema, | ||
YamlSplit, | ||
YamlSubConfigDict, | ||
YamlTransform, | ||
YamlTransformColumns, | ||
YamlTransformColumnsTransformation, | ||
) | ||
except ImportError: | ||
pytest.fail("Failed to import YAML Data types") | ||
|
||
|
||
def test_yaml_model_schema_types() -> None: | ||
"""Test the YAML model schema types.""" | ||
try: | ||
from stimulus.typing import ( | ||
CustomTunableParameter, | ||
Data, | ||
Loss, | ||
Model, | ||
RayTuneModel, | ||
RunParams, | ||
Scheduler, | ||
TunableParameter, | ||
Tune, | ||
TuneParams, | ||
YamlRayConfigLoader, | ||
) | ||
except ImportError: | ||
pytest.fail("Failed to import YAML Model Schema types") | ||
|
||
|
||
def test_type_aliases() -> None: | ||
"""Test the type aliases.""" | ||
try: | ||
from stimulus.typing import DataManager, Loader, RayTuneData, YamlData | ||
except ImportError: | ||
pytest.fail("Failed to import Type Aliases") |