diff --git a/test/nlp/test_autohf_classificationhead.py b/test/nlp/test_autohf_classificationhead.py index 39d0b89b9f..9ce023f966 100644 --- a/test/nlp/test_autohf_classificationhead.py +++ b/test/nlp/test_autohf_classificationhead.py @@ -21,6 +21,9 @@ "textattack/bert-base-uncased-MNLI", ] +if sys.platform.startswith("darwin") and sys.version_info[0] == 3 and sys.version_info[1] == 11: + pytest.skip("skipping Python 3.11 on MacOS", allow_module_level=True) + def test_switch_1_1(): data_idx, model_path_idx = 0, 0 diff --git a/test/nlp/test_default.py b/test/nlp/test_default.py index 7b8b252e25..b3c9016486 100644 --- a/test/nlp/test_default.py +++ b/test/nlp/test_default.py @@ -7,6 +7,9 @@ from flaml.default import portfolio +if sys.platform.startswith("darwin") and sys.version_info[0] == 3 and sys.version_info[1] == 11: + pytest.skip("skipping Python 3.11 on MacOS", allow_module_level=True) + def pop_args(fit_kwargs): fit_kwargs.pop("max_iter", None) diff --git a/test/tune/test_lexiflow.py b/test/tune/test_lexiflow.py index dda6b924cb..9ee46dc48b 100644 --- a/test/tune/test_lexiflow.py +++ b/test/tune/test_lexiflow.py @@ -1,7 +1,9 @@ import math +import sys from collections import defaultdict import numpy as np +import pytest import thop import torch import torch.nn as nn @@ -19,6 +21,9 @@ N_TRAIN_EXAMPLES = BATCHSIZE * 30 N_VALID_EXAMPLES = BATCHSIZE * 10 +if sys.platform.startswith("darwin") and sys.version_info[0] == 3 and sys.version_info[1] == 11: + pytest.skip("skipping Python 3.11 on MacOS", allow_module_level=True) + def _BraninCurrin(config): # Rescale brain diff --git a/test/tune/test_tune.py b/test/tune/test_tune.py index 658c5a387c..5f17272dc5 100644 --- a/test/tune/test_tune.py +++ b/test/tune/test_tune.py @@ -3,8 +3,10 @@ import logging import math import os +import sys import time +import pytest import sklearn.datasets import sklearn.metrics import xgboost as xgb @@ -17,6 +19,7 @@ except ImportError: print("skip test_xgboost because ray tune cannot be imported.") + logger = logging.getLogger(__name__) os.makedirs("logs", exist_ok=True) logger.addHandler(logging.FileHandler("logs/tune.log")) @@ -496,4 +499,8 @@ def _test_xgboost_bohb(): if __name__ == "__main__": + test_nested_run() + test_nested_space() + test_run_training_function_return_value() + test_passing_search_alg() test_xgboost_bs()