Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test mac os python 3.11 #1328

Merged
merged 14 commits into from
Aug 6, 2024
3 changes: 3 additions & 0 deletions test/nlp/test_autohf_classificationhead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/nlp/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions test/tune/test_lexiflow.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/tune/test_tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"))
Expand Down Expand Up @@ -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()
Loading