1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Description: Add random seed to test that fails under some circumstances
Bug-Debian: 848410
Author: Andreas Tille <tille@debian.org>
Last-Update: Mon, 19 Dec 2016 22:25:56 +0100
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -46,6 +46,7 @@ class UtilTests(TestCase):
self.biom_otu_table1_w_tax = parse_biom_table(biom_otu_table1_w_tax)
def test_generate_subsamples(self):
+ np.random.seed(123)
table = Table(np.array([[3, 1, 1], [0, 3, 3]]), ['O1', 'O2'],
['S1', 'S2', 'S3'])
actual_o1 = set()
--- a/tests/test_table.py
+++ b/tests/test_table.py
@@ -1440,6 +1440,7 @@ class SparseTableTests(TestCase):
def test_sum(self):
"""Test of sum!"""
+ np.random.seed(123)
self.assertEqual(self.st1.sum('whole'), 26)
npt.assert_equal(self.st1.sum('sample'), np.array([12, 14]))
npt.assert_equal(self.st1.sum('observation'), np.array([11, 15]))
|