ipython/ipython — Issue #1127: Interactive test scripts for Qt/nb issues
Author: minrk
Created: 2011-12-08 21:28:54+00:00
State: open
Labels: docs, htmlnotebook, prio-medium, qtconsole, testing, type-enhancement

Our ability to test qt and notebook code, due to its inherently human-interactive nature is sorely lacking. I know there are web and Qt testing tools, but what might provide a crude solution in the meantime would be to track some test scripts and notebooks, so that we have samples to run to more reliably evaluate whether things are well behaved.

For instance, for the recent carriage-return work in the qtconsole, we have the following cases:

Show that CR action properly overwrites lines:

```python
for i in range(10):
print '\r%s' % (i*str(i)),
sys.stdout.flush()
time.sleep(0.5)
```

CR clears whole lines, *unlike* the terminal:

```python
for i in range(9,1,-1):
print '\r%s' % (i*str(i)),
sys.stdout.flush()
time.sleep(0.5)
```

CRLF is treated as a newline:

```python
for i in range(10):
print '%s\r\n' % (i*str(i)),
sys.stdout.flush()
time.sleep(0.5)
```

Which we could run, with either `%loadpy`, or do as a Demo.

Perhaps we should keep these in `examples/tests/`?