Skip to content

Commit 3c00a7a

Browse files
Split up TestMinMax::test_uint
This is expected to fail, but has started to pass. I split out the example from the issue cited in the xfail to a new test, which fails as expected. However, the original `test_uint` (which isn't exactly the same as the example on Issue pymc-devs#770) is passing, while it is marked xfail.
1 parent e7554d9 commit 3c00a7a

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

tests/tensor/test_math.py

+22-11
Original file line numberDiff line numberDiff line change
@@ -1398,17 +1398,28 @@ def _grad_list(self):
13981398
# axis=1)[0], n)),axis=1)
13991399

14001400
@pytest.mark.xfail(reason="Fails due to #770")
1401-
def test_uint(self):
1402-
for dtype in ("uint8", "uint16", "uint32", "uint64"):
1403-
itype = np.iinfo(dtype)
1404-
data = np.array([itype.min + 3, itype.min, itype.max - 5, itype.max], dtype)
1405-
n = as_tensor_variable(data)
1406-
assert min(n).dtype == dtype
1407-
i = eval_outputs(min(n))
1408-
assert i == itype.min
1409-
assert max(n).dtype == dtype
1410-
i = eval_outputs(max(n))
1411-
assert i == itype.max
1401+
@pytest.mark.parametrize("dtype", ("uint8", "uint16", "uint32", "uint64"))
1402+
def test_uint(self, dtype):
1403+
itype = np.iinfo(dtype)
1404+
data = np.array([itype.min + 3, itype.min, itype.max - 5, itype.max], dtype)
1405+
n = as_tensor_variable(data)
1406+
1407+
assert min(n).dtype == dtype
1408+
i_min = eval_outputs(min(n))
1409+
assert i_min == itype.min
1410+
1411+
assert max(n).dtype == dtype
1412+
i_max = eval_outputs(max(n))
1413+
assert i_max == itype.max
1414+
1415+
@pytest.mark.xfail(reason="Fails due to #770")
1416+
def test_uint64_special_value(self):
1417+
dtype = "uint64"
1418+
data = np.array([0, 9223372036854775], dtype=dtype)
1419+
n = as_tensor_variable(data)
1420+
1421+
i_max = eval_outputs(max(n))
1422+
assert i_max == data.max()
14121423

14131424
def test_bool(self):
14141425
data = np.array([True, False], "bool")

0 commit comments

Comments
 (0)