Skip to content

Commit 73a97e2

Browse files
ricardoV94michaelosthege
authored andcommitted
Separate transitive shape checks into separate asserts
1 parent f7de7f4 commit 73a97e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pymc/tests/test_distributions_moments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def assert_moment_is_expected(model, expected, check_finite_logp=True):
161161
except NotImplementedError:
162162
random_draw = moment
163163

164-
assert moment.shape == expected.shape == random_draw.shape
164+
assert moment.shape == expected.shape
165+
assert expected.shape == random_draw.shape
165166
assert np.allclose(moment, expected)
166167

167168
if check_finite_logp:

pymc/tests/test_distributions_random.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ def check_rv_size(self):
375375
pymc_rv = self.pymc_dist.dist(**self.pymc_dist_params, size=size)
376376
expected_symbolic = tuple(pymc_rv.shape.eval())
377377
actual = pymc_rv.eval().shape
378-
assert actual == expected_symbolic == expected
378+
assert actual == expected_symbolic
379+
assert expected_symbolic == expected
379380

380381
# test multi-parameters sampling for univariate distributions (with univariate inputs)
381382
if (

0 commit comments

Comments
 (0)