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

Unified Diff: appengine/findit/crash/loglinear/test/weight_test.py

Issue 2753503002: [Predator] Fix weight flaky loglinear training test. (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: appengine/findit/crash/loglinear/test/weight_test.py
diff --git a/appengine/findit/crash/loglinear/test/weight_test.py b/appengine/findit/crash/loglinear/test/weight_test.py
index c1e882395d8f1b90935bb36c3b353c9df2f9e09d..9e3cb0ca7c703f37ae3123e0f8aeb8d02a71ad3a 100644
--- a/appengine/findit/crash/loglinear/test/weight_test.py
+++ b/appengine/findit/crash/loglinear/test/weight_test.py
@@ -60,12 +60,12 @@ class MetaWeightTest(unittest.TestCase):
MetaFeatureValue('f', {'f1': 2., 'f2': 1.}), 2.)
self.assertEqual(MetaFeatureValue('f', {'f1': 0.8, 'f2': 0.4}) *
MetaWeight({'f1': Weight(2.), 'f2': Weight(1.)}), 2.)
- with self.assertRaisesRegexp(Exception,
stgao 2017/03/14 04:34:33 So you mentioned in the bug "when the trained weig
Sharu Jiang 2017/03/14 05:09:17 No, the flaky test is ``testTrainWeights`` in trai
- ('MetaWeight can only multiply with '
- '``MetaFeatureValue`` '
- 'with the same length')):
- dummy_result = MetaWeight({'f1': 0.8, 'f2': 0.4}) * MetaFeatureValue(
- 'f', {'f1': 2.})
+
+ self.assertEqual(
+ MetaWeight({'f1': Weight(0.8), 'f3': Weight(0.0)}) *
+ MetaFeatureValue('f', {'f1': Weight(2.), 'f2': Weight(9),
+ 'f3': Weight(10)}),
+ 1.6)
def testIter(self):
"""Tests overloading operator ``__iter__``."""
« no previous file with comments | « no previous file | appengine/findit/crash/loglinear/weight.py » ('j') | appengine/findit/crash/loglinear/weight.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698