Skip to content

Commit 67c5fb2

Browse files
Adapt tests
1 parent 9a42b38 commit 67c5fb2

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

tests/test_results.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,3 @@ def test_empty(n):
430430
v2 = ValuationResult(values=np.arange(n))
431431
v += v2
432432
assert len(v2) == n
433-
434-
435-
def test_empty_deprecation():
436-
with pytest.warns(DeprecationWarning):
437-
v3 = ValuationResult.empty(indices=[1, 2, 3])

tests/value/test_stopping.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def _check(self, result: ValuationResult) -> Status:
6262
assert (C() & C() & C())(v) == c
6363
assert (P() | P() | P())(v) == p
6464

65-
assert (C() & P()).name == "Composite StoppingCriterion: C AND P"
66-
assert (C() | P()).name == "Composite StoppingCriterion: C OR P"
67-
assert (~C()).name == "Composite StoppingCriterion: NOT C"
68-
assert (~P()).name == "Composite StoppingCriterion: NOT P"
65+
assert str(C() & P()) == "Composite StoppingCriterion: C AND P"
66+
assert str(C() | P()) == "Composite StoppingCriterion: C OR P"
67+
assert str(~C()) == "Composite StoppingCriterion: NOT C"
68+
assert str(~P()) == "Composite StoppingCriterion: NOT P"
6969

7070

7171
def test_make_criterion():
@@ -88,9 +88,9 @@ def always_failed(result: ValuationResult) -> Status:
8888
assert P()(v) == Status.Pending
8989
assert F()(v) == Status.Failed
9090

91-
assert C().name == "always_converged"
92-
assert P().name == "always_pending"
93-
assert F().name == "always_failed"
91+
assert str(C()) == "always_converged"
92+
assert str(P()) == "always_pending"
93+
assert str(F()) == "always_failed"
9494

9595
assert (~C())(v) == Status.Failed
9696
assert (~P())(v) == Status.Converged
@@ -104,7 +104,7 @@ def always_failed(result: ValuationResult) -> Status:
104104

105105
def test_minmax_updates():
106106
maxstop = MaxUpdates(10)
107-
assert maxstop.name == "MaxUpdates"
107+
assert str(maxstop) == "MaxUpdates(n_updates=10)"
108108
v = ValuationResult.from_random(5)
109109
v._counts = np.zeros(5)
110110
assert maxstop(v) == Status.Pending
@@ -114,7 +114,7 @@ def test_minmax_updates():
114114
assert maxstop(v) == Status.Converged
115115

116116
minstop = MinUpdates(10)
117-
assert minstop.name == "MinUpdates"
117+
assert str(minstop) == "MinUpdates(n_updates=10)"
118118
v._counts = np.zeros(5)
119119
assert minstop(v) == Status.Pending
120120
v._counts += np.ones(5) * 9

0 commit comments

Comments
 (0)