Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/resources/significantly_different_test.py

Issue 1610203003: Iteratively increase sample size for good/bad classification. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebasing Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 """Tests for significantly_different."""
3
4 import os
5 import sys
6 import unittest
7
8 # pylint: disable=relative-import
9 import significantly_different
10
11
12 class SignificantlyDifferentTest(unittest.TestCase):
13
14 def setUp(self):
15 self.conda_path = None
16 try:
17 import scipy # pylint: disable=unused-variable
18 self.conda_path = sys.executable
19 except ImportError:
20 if os.path.exists(os.path.expanduser('~/conda-test/bin/python')):
21 self.conda_path = os.path.expanduser('~/conda-test/bin/python')
22
23 def test_basic_case(self):
24 try:
25 results = significantly_different.main(
26 ['', '[1, 2, 3, 3, 2, 1]', '[1, 2, 2, 2, 5, 0]', '0.05'],
27 self.conda_path)
28 except significantly_different.ScipyNotInstalledError:
29 # This is meant to let presubmit pass on CQ bots :( because they don't
30 # have scipy either directly or thorugh anaconda.
31 return
32
33 self.assertAlmostEqual(
34 0.40073980338363635,
35 results['mann_p_value'])
36
37 if __name__ == '__main__':
38 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698