Skip to content

Commit

Permalink
Parametrize test for various ppds -- not passing!
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Nov 7, 2022
1 parent e80ee72 commit 3bb841f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/papers/test_domijan2015.py
@@ -1,5 +1,6 @@
import json
import os.path
from itertools import product

import numpy as np
import pytest
Expand All @@ -21,9 +22,9 @@ def test_stim(stim_name):
assert stim["mask"] == loaded[stim_name]["mask"], "masks are different"


@pytest.mark.parametrize("stim_name", stimlist)
def test_ppd(stim_name):
@pytest.mark.parametrize("stim_name, ppd", product(stimlist, (5, 10, 15, 20)))
def test_ppd(stim_name, ppd):
func = getattr(stimuli.papers.domijan2015, stim_name)

stim = func(ppd=20, shape=None)
assert np.all(stim["img"].shape == np.array(stim["original_shape"]) * 2)
stim = func(ppd=ppd, shape=None)
assert np.all(stim["img"].shape == np.array(stim["original_shape"]) * (ppd / 10))

0 comments on commit 3bb841f

Please sign in to comment.