Testing with pymc traces

You can set a random seed when sampling so that the randomness is reproducible for unit tests - e.g. pm.sample(random_seed=0). You could also use math.isclose to test something is near enough to the expected value