:py:mod:`bluecast.tests.test_base_classes` ========================================== .. py:module:: bluecast.tests.test_base_classes .. autoapi-nested-parse:: Tests for base_classes module functionality. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: bluecast.tests.test_base_classes.SimpleSampler bluecast.tests.test_base_classes.TestXgboostBaseModel bluecast.tests.test_base_classes.TestCatboostBaseModel bluecast.tests.test_base_classes.TestBaseClassesIntegration .. py:class:: SimpleSampler(seed) A simple class that can be pickled for testing. .. py:class:: TestXgboostBaseModel Test the XgboostBaseModel base class functionality. .. py:method:: xgboost_base_model() Create a basic XgboostBaseModel instance for testing. .. py:method:: test_create_optuna_study_basic(xgboost_base_model) Test basic optuna study creation without database backend. .. py:method:: test_create_optuna_study_with_sampler_and_pruner(xgboost_base_model) Test optuna study creation with sampler and pruner. .. py:method:: test_create_optuna_study_with_database_backend(xgboost_base_model) Test optuna study creation with database backend configuration. .. py:method:: test_create_optuna_study_with_database_backend_and_tpe_sampler(xgboost_base_model) Test optuna study creation with database backend and TPESampler (which doesn't save state due to no seed attr). .. py:method:: test_create_optuna_study_with_database_backend_and_simple_sampler_with_seed(xgboost_base_model) Test optuna study creation with database backend and simple sampler that has seed attribute. .. py:method:: test_create_optuna_study_with_database_backend_and_sampler_without_seed(xgboost_base_model) Test optuna study creation with database backend and sampler without seed attribute. .. py:method:: test_create_optuna_study_sampler_save_error_handling(xgboost_base_model) Test error handling when sampler state saving fails. .. py:method:: test_create_optuna_study_with_database_backend_none(xgboost_base_model) Test optuna study creation when database backend path is None. .. py:method:: test_create_optuna_study_with_database_backend_non_string(xgboost_base_model) Test optuna study creation when database backend path is not a string. .. py:method:: test_create_optuna_study_load_if_exists_with_database(xgboost_base_model) Test that load_if_exists is set to True when using database backend. .. py:class:: TestCatboostBaseModel Test the CatboostBaseModel base class functionality. .. py:method:: catboost_base_model() Create a basic CatboostBaseModel instance for testing. .. py:method:: test_catboost_create_optuna_study_basic(catboost_base_model) Test basic optuna study creation for CatBoost without database backend. .. py:method:: test_catboost_create_optuna_study_with_database_backend(catboost_base_model) Test CatBoost optuna study creation with database backend configuration. .. py:method:: test_catboost_create_optuna_study_with_database_backend_and_simple_sampler(catboost_base_model) Test CatBoost optuna study creation with database backend and simple sampler with seed. .. py:method:: test_catboost_create_optuna_study_sampler_save_error_handling(catboost_base_model) Test CatBoost error handling when sampler state saving fails. .. py:class:: TestBaseClassesIntegration Integration tests for base classes functionality. .. py:method:: test_xgboost_database_backend_file_creation_with_error_handling() Test database backend creation with error handling for permission issues. .. py:method:: test_sampler_replacement_strategy_with_simple_sampler() Test that .db is correctly replaced with _sampler.pkl in path. .. py:method:: test_study_kwargs_construction() Test that study kwargs are constructed correctly. .. py:method:: test_tpe_sampler_behavior_documentation() Test to document the current TPESampler behavior (no accessible seed attribute).