Permalink
Browse files

TST: fix failing bootstrapped p-value test

Fixes #2078.
  • Loading branch information...
1 parent 8f10a19 commit d898269c2816afdcde0b9de66fb8214ff3334a33 @jairideout jairideout committed Apr 29, 2016
Showing with 8 additions and 3 deletions.
  1. +8 −3 tests/test_otu_significance.py
@@ -865,7 +865,8 @@ def test_run_correlation_test(self):
0.045999999999999999,
0.38200000000000001,
0.88200000000000001,
- 0.438]
+ 0.438,
+ 0.54600000000000004]
obs_ccs, obs_pvals = run_correlation_test(data_gen, 'pearson',
CORRELATION_TEST_CHOICES,
@@ -890,8 +891,12 @@ def test_run_correlation_test(self):
# permutations used in the test, this difference is 1 / 1000 = 0.001,
# hence the smaller number of decimal places used here in the
# comparison.
- assert_almost_equal(obs_pvals[:-1], exp_bootstrapped_pvals)
- assert_almost_equal(obs_pvals[-1], 0.54600000000000004, decimal=2)
+ assert_almost_equal(obs_pvals[0], exp_bootstrapped_pvals[0])
+ assert_almost_equal(obs_pvals[1], exp_bootstrapped_pvals[1])
+ assert_almost_equal(obs_pvals[2], exp_bootstrapped_pvals[2], decimal=1)
+ assert_almost_equal(obs_pvals[3], exp_bootstrapped_pvals[3])
+ assert_almost_equal(obs_pvals[4], exp_bootstrapped_pvals[4])
+ assert_almost_equal(obs_pvals[5], exp_bootstrapped_pvals[5], decimal=2)
# spearman
exp_ccs = [0.25714285714285712,

0 comments on commit d898269

Please sign in to comment.