[LNT] r293975 - PEP8 fixups
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 16:52:24 PST 2017
Author: cmatthews
Date: Thu Feb 2 18:52:24 2017
New Revision: 293975
URL: http://llvm.org/viewvc/llvm-project?rev=293975&view=rev
Log:
PEP8 fixups
Modified:
lnt/trunk/tests/server/ui/statsTester.py
Modified: lnt/trunk/tests/server/ui/statsTester.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/statsTester.py?rev=293975&r1=293974&r2=293975&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/statsTester.py (original)
+++ lnt/trunk/tests/server/ui/statsTester.py Thu Feb 2 18:52:24 2017
@@ -18,35 +18,45 @@ INDEX = 0
class TestLNTStatsTester(unittest.TestCase):
- def loc_test_agg_mean(self, values):
+ @staticmethod
+ def _loc_test_agg_mean(values):
if values is None:
return stats.agg_mean(None)
- agg_value, agg_index = stats.agg_mean((value, index) for (index, value) in enumerate(values))
- return (agg_value, agg_index)
+ agg_value, agg_index = stats.agg_mean(
+ (value, index) for (index, value) in enumerate(values))
+ return agg_value, agg_index
def test_agg_mean(self):
test_list1 = [1, 2, 3, 4, 6]
- self.assertEqual(self.loc_test_agg_mean(test_list1), (3.2, INDEX))
+ self.assertEqual(TestLNTStatsTester._loc_test_agg_mean(test_list1),
+ (3.2, INDEX))
test_list2 = [1.0, 2.0, 3.0, 4.0]
- self.assertEqual(self.loc_test_agg_mean(test_list2), (2.5, INDEX))
+ self.assertEqual(TestLNTStatsTester._loc_test_agg_mean(test_list2),
+ (2.5, INDEX))
test_list3 = [1.0]
- self.assertEqual(self.loc_test_agg_mean(test_list3), (1.0, INDEX))
- self.assertEqual(self.loc_test_agg_mean([]), (None, None))
- self.assertEqual(self.loc_test_agg_mean(None), (None, None))
+ self.assertEqual(TestLNTStatsTester._loc_test_agg_mean(test_list3),
+ (1.0, INDEX))
+ self.assertEqual(TestLNTStatsTester._loc_test_agg_mean([]),
+ (None, None))
+ self.assertEqual(TestLNTStatsTester._loc_test_agg_mean(None),
+ (None, None))
# Test it exactly how it is called in views.py without indirection
- agg_value, agg_index = stats.agg_mean((value, index) for (index, value) in enumerate(test_list1))
+ agg_value, agg_index = stats.agg_mean(
+ (value, index) for (index, value) in enumerate(test_list1))
self.assertEqual((3.2, INDEX), (agg_value, agg_index))
- agg_value, agg_index = stats.agg_mean((value, index) for (index, value) in enumerate(test_list2))
+ agg_value, agg_index = stats.agg_mean(
+ (value, index) for (index, value) in enumerate(test_list2))
self.assertEqual((2.5, INDEX), (agg_value, agg_index))
- agg_value, agg_index = stats.agg_mean((value, index) for (index, value) in enumerate(test_list3))
+ agg_value, agg_index = stats.agg_mean(
+ (value, index) for (index, value) in enumerate(test_list3))
self.assertEqual((1.0, INDEX), (agg_value, agg_index))
if __name__ == '__main__':
try:
unittest.main()
except AttributeError:
- # Command line parameters are treaded as test cases, when \
+ # Command line parameters are treated as test cases, when \
# running with lit rather than python directly.
import sys
if len(sys.argv) != 2:
More information about the llvm-commits
mailing list