Model a simple failure in the non-concurrent case.
()
| 119 | |
| 120 | |
| 121 | def test_simple_fail(): |
| 122 | """Model a simple failure in the non-concurrent case.""" |
| 123 | group = worker.WalTransferGroup(FakeWalUploader()) |
| 124 | |
| 125 | exp = Explosion('fail') |
| 126 | seg = FakeWalSegment('1' * 8 * 3, explicit=True, upload_explosive=exp) |
| 127 | |
| 128 | group.start(seg) |
| 129 | |
| 130 | with pytest.raises(Explosion) as e: |
| 131 | group.join() |
| 132 | |
| 133 | assert e.value is exp |
| 134 | assert failed(seg) |
| 135 | |
| 136 | |
| 137 | def test_multi_explicit_fail(): |
nothing calls this directly
no test coverage detected