Skip to content

Commit

Permalink
Check for error loading bad trace directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpgoldman committed Jun 27, 2019
1 parent 619363b commit 783c4a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pymc3/tests/test_ndarray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ def test_save_and_load(self, tmpdir_factory):
for var in ('x', 'z'):
assert (self.trace[var] == trace2[var]).all()

def test_bad_load(self, tmpdir_factory):
directory = str(tmpdir_factory.mktemp('data'))
with pytest.raises(Exception):
pm.load_trace(directory, model=TestSaveLoad.model())

def test_sample_posterior_predictive(self, tmpdir_factory):
directory = str(tmpdir_factory.mktemp('data'))
save_dir = pm.save_trace(self.trace, directory, overwrite=True)
Expand Down

0 comments on commit 783c4a7

Please sign in to comment.