(capsys)
| 18 | not haveIPython, reason="Can't run variable tests without IPython console" |
| 19 | ) |
| 20 | def test_variable_list(capsys): |
| 21 | from IPython import get_ipython |
| 22 | |
| 23 | # Execute a single cell before we get the variables. |
| 24 | get_ipython().run_cell("x = 3\r\ny = 4\r\nz=5") |
| 25 | vars = get_variables(capsys) |
| 26 | have_x = False |
| 27 | have_y = False |
| 28 | have_z = False |
| 29 | for sub in vars: |
| 30 | have_x |= sub["name"] == "x" |
| 31 | have_y |= sub["name"] == "y" |
| 32 | have_z |= sub["name"] == "z" |
| 33 | assert have_x |
| 34 | assert have_y |
| 35 | assert have_z |
| 36 | |
| 37 | |
| 38 | @pytest.mark.skipif( |
nothing calls this directly
no test coverage detected