Skip to content

Commit

Permalink
Test new behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Apr 28, 2022
1 parent 37e76c7 commit 848564d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions nimare/tests/test_meta_mkda.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test nimare.meta.mkda (KDA-based meta-analytic algorithms)."""
import logging

import numpy as np
import pytest

import nimare
from nimare.correct import FDRCorrector, FWECorrector
Expand Down Expand Up @@ -34,7 +35,7 @@ def test_MKDADensity_kernel_instance(testdata_cbma):
assert isinstance(res, nimare.results.MetaResult)


def test_MKDADensity_approximate_null(testdata_cbma_full):
def test_MKDADensity_approximate_null(testdata_cbma_full, caplog):
"""Smoke test for MKDADensity with the "approximate" null_method."""
meta = MKDADensity(null="approximate")
res = meta.fit(testdata_cbma_full)
Expand All @@ -51,8 +52,14 @@ def test_MKDADensity_approximate_null(testdata_cbma_full):
n_cores=1,
vfwe_only=True,
)
with pytest.raises(ValueError):
corr2.transform(res)
with caplog.at_level(logging.WARNING):
cres2 = corr2.transform(res)

assert "Running permutations from scratch." in caplog.text

assert isinstance(cres2, nimare.results.MetaResult)
assert "logp_level-voxel_corr-FWE_method-montecarlo" in cres2.maps
assert "logp_desc-size_level-cluster_corr-FWE_method-montecarlo" not in cres2.maps


def test_MKDADensity_montecarlo_null(testdata_cbma):
Expand Down

0 comments on commit 848564d

Please sign in to comment.