Browse code

fix 'test_small_deviations' by making it stop when loss==0

Bas Nijholt authored on 11/07/2018 02:11:43
Showing 1 changed files
... ...
@@ -455,6 +455,11 @@ def test_small_deviations():
455 455
         for _ in range(5):
456 456
             learner.tell(stash.pop(), learner.function(x))
457 457
 
458
+        if learner.loss() == 0:
459
+            # If this condition is met, the learner can't return any
460
+            # more points.
461
+            break
462
+
458 463
 
459 464
 @pytest.mark.xfail
460 465
 @run_with(Learner1D, Learner2D, LearnerND)