from IPython import get_ipython
from IPython.testing import tools as tt
from IPython.terminal.interactiveshell import TerminalInteractiveShell


def test_full_cycle():
    shell = TerminalInteractiveShell.instance()
    ip = get_ipython()

    with tt.AssertPrints('time: '):
        ip.run_cell("%load_ext autotime")

    with tt.AssertPrints('time: '):
        ip.run_cell("x = 1")

    with tt.AssertPrints(''):
        ip.run_cell("%unload_ext autotime")

@@ -289,17 +289,17 @@
 un_cell(
-%22
+'
 %25load_ex
@@ -308,17 +308,17 @@
 autotime
-%22
+'
 )%0A%0A    w
@@ -372,15 +372,15 @@
 ell(
-%22
+'
 x = 1
-%22
+'
 )%0A%0A 
@@ -396,24 +396,27 @@
 t.Assert
+Not
 Prints('
 '):%0A    
@@ -407,16 +407,22 @@
 Prints('
+time: 
 '):%0A    
@@ -437,17 +437,17 @@
 un_cell(
-%22
+'
 %25unload_
@@ -462,7 +462,7 @@
 time
-%22
+'
 )%0A

Make unload test assertion explicit