()
| 2 | |
| 3 | |
| 4 | def test_display_data(): |
| 5 | with CodeInterpreter() as sandbox: |
| 6 | # plot random graph |
| 7 | result = sandbox.notebook.exec_cell( |
| 8 | """ |
| 9 | import matplotlib.pyplot as plt |
| 10 | import numpy as np |
| 11 | |
| 12 | x = np.linspace(0, 20, 100) |
| 13 | y = np.sin(x) |
| 14 | |
| 15 | plt.plot(x, y) |
| 16 | plt.show() |
| 17 | """ |
| 18 | ) |
| 19 | |
| 20 | # there's your image |
| 21 | image = result.display_data[0] |
| 22 | assert "image/png" in image |
| 23 | assert "text/plain" in image |
nothing calls this directly
no test coverage detected
searching dependent graphs…