Skip to content

Commit

Permalink
update reduction test params
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdavis committed Sep 9, 2024
1 parent b5ba281 commit ebf72fc
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/metrics/test_attacks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# stdlib
import sys
from typing import Type

# third party
Expand All @@ -14,16 +15,21 @@
from synthcity.plugins import Plugins
from synthcity.plugins.core.dataloader import GenericDataLoader


@pytest.mark.parametrize("reduction", ["mean", "max", "min"])
@pytest.mark.parametrize(
"evaluator_t",
[
# Define parameters for different OSes
if sys.platform == "darwin": # macOS
reduction_params = ["mean"] # Only run "mean" on macOS
evaluator_params = [DataLeakageLinear] # Only run this evaluator on macOS
else: # Linux and Windows
reduction_params = ["mean", "max", "min"] # Run all on Linux/Windows
evaluator_params = [
DataLeakageLinear,
DataLeakageXGB,
DataLeakageMLP,
],
)
] # All evaluators


@pytest.mark.parametrize("reduction", reduction_params)
@pytest.mark.parametrize("evaluator_t", evaluator_params)
def test_reduction(reduction: str, evaluator_t: Type) -> None:
X, y = load_diabetes(return_X_y=True, as_frame=True)
X["target"] = y
Expand Down

0 comments on commit ebf72fc

Please sign in to comment.