From ed5d763ecc61ca0592d5dcdfcb04986d50a17f46 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 28 Mar 2026 11:43:43 +0900 Subject: [PATCH] Remove tests for free-threaded support --- .github/workflows/tests.yml | 23 ++--------------------- tests/test_free_threaded.py | 22 ---------------------- 2 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 tests/test_free_threaded.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e3ee06..4c092c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,26 +40,7 @@ jobs: run: | python -m pip install --upgrade pip setuptools numpy scipy hypothesis pytest torch gpytorch pip install --progress-bar off . - - run: python -m pytest tests --ignore=tests/test_free_threaded.py - test-free-threaded: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # TODO: Replace deadsnakes with setup-python when the support for Python 3.13t is added - - name: Setup Python 3.13t - uses: deadsnakes/action@v3.1.0 - with: - python-version: "3.13-dev" - nogil: true - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools numpy hypothesis pytest pytest-freethreaded - pip install --progress-bar off . - - run: python -m pytest --threads 1 --iterations 1 tests --ignore=tests/test_free_threaded.py - # TODO: Using `unittest` style causes `pytest-freethreaded` to fail with `ConcurrencyError`. - # Rewriting as top-level functions works, - # so a follow-up is needed to refactor from `unittest` to `pytest`. - - run: python -m pytest --threads 1 --iterations 1 --require-gil-disabled tests/test_free_threaded.py + - run: python -m pytest tests test-numpy2: runs-on: ubuntu-latest steps: @@ -73,4 +54,4 @@ jobs: python -m pip install --upgrade pip setuptools scipy hypothesis pytest torch gpytorch python -m pip install --pre --upgrade numpy pip install --progress-bar off . - - run: python -m pytest tests --ignore=tests/test_free_threaded.py \ No newline at end of file + - run: python -m pytest tests diff --git a/tests/test_free_threaded.py b/tests/test_free_threaded.py deleted file mode 100644 index 6795243..0000000 --- a/tests/test_free_threaded.py +++ /dev/null @@ -1,22 +0,0 @@ -import numpy as np -import pytest -from cmaes import CMA - - -@pytest.mark.freethreaded(threads=10, iterations=200) -def test_simple_optimization(): - optimizer = CMA(mean=np.zeros(2), sigma=1.3) - - def quadratic(x1: float, x2: float) -> float: - return (x1 - 3) ** 2 + (10 * (x2 + 2)) ** 2 - - while True: - solutions = [] - for _ in range(optimizer.population_size): - x = optimizer.ask() - value = quadratic(x[0], x[1]) - solutions.append((x, value)) - optimizer.tell(solutions) - - if optimizer.should_stop(): - break