(self)
| 151 | class test_bgThread: |
| 152 | |
| 153 | def test_crash(self): |
| 154 | |
| 155 | class T(bgThread): |
| 156 | |
| 157 | def body(self): |
| 158 | raise KeyError() |
| 159 | |
| 160 | with patch('os._exit') as _exit: |
| 161 | with conftest.stdouts(): |
| 162 | _exit.side_effect = ValueError() |
| 163 | t = T() |
| 164 | with pytest.raises(ValueError): |
| 165 | t.run() |
| 166 | _exit.assert_called_with(1) |
| 167 | |
| 168 | def test_interface(self): |
| 169 | x = bgThread() |