Exemplo n.º 1
0
    def test_any(self):
        """should return True if any dones is True if early_stopping is 'any'."""
        tests = TaskList(None, early_stopping="any")

        tests.dones = [True, False, True]
        check.is_true(tests._stacked_dones())

        tests.dones = [False, False, False]
        check.is_false(tests._stacked_dones())
Exemplo n.º 2
0
 def test_raise_othervalue(self):
     """should raise ValueError if early_stopping is not in ('any', 'all')."""
     tests = TaskList(None, early_stopping="x")
     tests.dones = [True, False, True]
     with pytest.raises(ValueError, match=r"Unknown value for early_stopping.*"):
         tests._stacked_dones()