|
9 | 9 | import tables |
10 | 10 |
|
11 | 11 | from activitysim.core import workflow |
| 12 | +from activitysim.core.exceptions import CheckpointNameNotFoundError |
12 | 13 | from activitysim.core.test.extensions import steps |
13 | 14 |
|
14 | 15 | # set the max households for all tests (this is to limit memory use on travis) |
@@ -70,17 +71,17 @@ def test_pipeline_run(state): |
70 | 71 | state.checkpoint.load_dataframe("table1", checkpoint_name="step3") |
71 | 72 |
|
72 | 73 | # try to get a table from a step before it was checkpointed |
73 | | - with pytest.raises(RuntimeError) as excinfo: |
| 74 | + with pytest.raises(CheckpointNameNotFoundError) as excinfo: |
74 | 75 | state.checkpoint.load_dataframe("table2", checkpoint_name="step1") |
75 | 76 | assert "not in checkpoint 'step1'" in str(excinfo.value) |
76 | 77 |
|
77 | 78 | # try to get a non-existant table |
78 | | - with pytest.raises(RuntimeError) as excinfo: |
| 79 | + with pytest.raises(CheckpointNameNotFoundError) as excinfo: |
79 | 80 | state.checkpoint.load_dataframe("bogus") |
80 | 81 | assert "never checkpointed" in str(excinfo.value) |
81 | 82 |
|
82 | 83 | # try to get an existing table from a non-existant checkpoint |
83 | | - with pytest.raises(RuntimeError) as excinfo: |
| 84 | + with pytest.raises(CheckpointNameNotFoundError) as excinfo: |
84 | 85 | state.checkpoint.load_dataframe("table1", checkpoint_name="bogus") |
85 | 86 | assert "not in checkpoints" in str(excinfo.value) |
86 | 87 |
|
@@ -111,12 +112,12 @@ def test_pipeline_checkpoint_drop(state): |
111 | 112 |
|
112 | 113 | state.checkpoint.load_dataframe("table1") |
113 | 114 |
|
114 | | - with pytest.raises(RuntimeError) as excinfo: |
| 115 | + with pytest.raises(CheckpointNameNotFoundError) as excinfo: |
115 | 116 | state.checkpoint.load_dataframe("table2") |
116 | 117 | # assert "never checkpointed" in str(excinfo.value) |
117 | 118 |
|
118 | 119 | # can't get a dropped table from current checkpoint |
119 | | - with pytest.raises(RuntimeError) as excinfo: |
| 120 | + with pytest.raises(CheckpointNameNotFoundError) as excinfo: |
120 | 121 | state.checkpoint.load_dataframe("table3") |
121 | 122 | # assert "was dropped" in str(excinfo.value) |
122 | 123 |
|
|
0 commit comments