File: random_seed_for_test.patch

package info (click to toggle)
python-biom-format 2.1.5%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 51,844 kB
  • ctags: 1,341
  • sloc: python: 11,620; makefile: 128; sh: 65
file content (25 lines) | stat: -rw-r--r-- 955 bytes parent folder | download
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]))