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

Side by Side Diff: tools/auto_bisect/ttest_test.py

Issue 529593002: In the presubmit for auto-bisect, run pylint and unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « tools/auto_bisect/source_control.py ('k') | tools/bisect-perf-regression.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Unit tests for ttest module.""" 5 """Unit tests for ttest module."""
6 6
7 import unittest 7 import unittest
8 8
9 import ttest 9 import ttest
10 10
11 11
12 # This test case accesses private functions of the ttest module.
13 # pylint: disable=W0212
12 class TTestTest(unittest.TestCase): 14 class TTestTest(unittest.TestCase):
13 """Tests for the t-test functions.""" 15 """Tests for the t-test functions."""
14 16
15 def testWelchsFormula(self): 17 def testWelchsFormula(self):
16 """Tests calculation of the t value.""" 18 """Tests calculation of the t value."""
17 # Results can be verified by directly plugging variables into Welch's 19 # Results can be verified by directly plugging variables into Welch's
18 # equation (e.g. using a calculator or the Python interpreter). 20 # equation (e.g. using a calculator or the Python interpreter).
19 self.assertEqual( 21 self.assertEqual(
20 -0.2796823595120407, 22 -0.2796823595120407,
21 ttest._TValue(0.299, 0.307, 0.05, 0.08, 150, 165)) 23 ttest._TValue(0.299, 0.307, 0.05, 0.08, 150, 165))
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 self.assertEqual(1, ttest._LookupPValue(0.0, 1)) 115 self.assertEqual(1, ttest._LookupPValue(0.0, 1))
114 self.assertEqual(1, ttest._LookupPValue(0.0, 2)) 116 self.assertEqual(1, ttest._LookupPValue(0.0, 2))
115 117
116 def testLookupLargeDF(self): 118 def testLookupLargeDF(self):
117 """Tests a lookup when the given degrees of freedom is large.""" 119 """Tests a lookup when the given degrees of freedom is large."""
118 self.assertEqual(0.02, ttest._LookupPValue(5.0, 50)) 120 self.assertEqual(0.02, ttest._LookupPValue(5.0, 50))
119 121
120 122
121 if __name__ == '__main__': 123 if __name__ == '__main__':
122 unittest.main() 124 unittest.main()
OLDNEW
« no previous file with comments | « tools/auto_bisect/source_control.py ('k') | tools/bisect-perf-regression.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698