TestPanicGeneratesError tests that executing code with an un-recovered panic properly generates both an error "execute_reply" and publishes an "error" message.
(t *testing.T)
| 194 | // TestPanicGeneratesError tests that executing code with an un-recovered panic properly generates both |
| 195 | // an error "execute_reply" and publishes an "error" message. |
| 196 | func TestPanicGeneratesError(t *testing.T) { |
| 197 | client, closeClient := newTestJupyterClient(t) |
| 198 | defer closeClient() |
| 199 | |
| 200 | content, pub := client.executeCode(t, `panic("error")`) |
| 201 | |
| 202 | status := getString(t, "content", content, "status") |
| 203 | |
| 204 | if status != "error" { |
| 205 | t.Fatalf("\t%s Execution did not raise expected error", failure) |
| 206 | } |
| 207 | |
| 208 | var foundPublishedError bool |
| 209 | for _, pubMsg := range pub { |
| 210 | if pubMsg.Header.MsgType == "error" { |
| 211 | foundPublishedError = true |
| 212 | break |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | if !foundPublishedError { |
| 217 | t.Fatalf("\t%s Execution did not publish an expected \"error\" message", failure) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | // TestPrintStdout tests that data written to stdout publishes the same data in a "stdout" "stream" message. |
| 222 | func TestPrintStdout(t *testing.T) { |
nothing calls this directly
no test coverage detected