Skip to content

Commit

Permalink
added mpi test markers for skipping the tests without mpi
Browse files Browse the repository at this point in the history
  • Loading branch information
Oskar Taubert committed Nov 6, 2023
1 parent 4bc3e38 commit b14a316
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_cmaes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
import tempfile
from operator import attrgetter

import pytest

from propulate import Propulator
from propulate.propagators import CMAPropagator, BasicCMA
from propulate.utils import sphere


@pytest.mark.mpi_skip
def test_PSO():
"""
Test single worker using Propulator to optimize sphere using a PSO propagator.
Expand Down
4 changes: 4 additions & 0 deletions tests/test_population.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from propulate.population import Individual

import pytest


@pytest.mark.mpi_skip
def test_individual():
ind_map = {
"float1": 0.1,
Expand All @@ -15,5 +18,6 @@ def test_individual():
print(ind)


@pytest.mark.mpi_skip
def test_limits():
raise
4 changes: 4 additions & 0 deletions tests/test_propulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
import logging
from copy import deepcopy

import pytest

from propulate import Propulator
from propulate.utils import get_default_propagator, set_logger_config, sphere


@pytest.mark.mpi_skip
def test_Propulator():
"""
Test single worker using Propulator to optimize sphere.
Expand Down Expand Up @@ -52,6 +55,7 @@ def test_Propulator():
assert best.loss < 0.8


@pytest.mark.mpi_skip
def test_checkpointing_propulator():
rng = random.Random(42) # Separate random number generator for optimization.
limits = {
Expand Down

0 comments on commit b14a316

Please sign in to comment.