src/tests/test_magic.py
def ip():
    """Provides an IPython session in which tables have been created"""

    ip_session = get_ipython()
    runsql(
        ip_session,
        [
            "CREATE TABLE test (n INT, name TEXT)",
            "INSERT INTO test VALUES (1, 'foo')",
            "INSERT INTO test VALUES (2, 'bar')",
            "CREATE TABLE author (first_name, last_name, year_of_death)",
            "INSERT INTO author VALUES ('William', 'Shakespeare', 1616)",
            "INSERT INTO author VALUES ('Bertold', 'Brecht', 1956)",
        ],
    )
    yield ip_session
    runsql(ip_session, "DROP TABLE test")
    runsql(ip_session, "DROP TABLE author")
Provides an IPython session in which tables have been created
Provides an IPython session in which tables have been created
Provides an IPython session in which tables have been created
def ip():
    ip_session = get_ipython()
    runsql(
        ip_session,
        [
            "CREATE TABLE test (n INT, name TEXT)",
            "INSERT INTO test VALUES (1, 'foo')",
            "INSERT INTO test VALUES (2, 'bar')",
            "CREATE TABLE author (first_name, last_name, year_of_death)",
            "INSERT INTO author VALUES ('William', 'Shakespeare', 1616)",
            "INSERT INTO author VALUES ('Bertold', 'Brecht', 1956)",
        ],
    )
    yield ip_session
    runsql(ip_session, "DROP TABLE test")
    runsql(ip_session, "DROP TABLE author")
def ip ( ) : ip_session = get_ipython ( ) runsql ( ip_session , [ "CREATE TABLE test (n INT, name TEXT)" , "INSERT INTO test VALUES (1, 'foo')" , "INSERT INTO test VALUES (2, 'bar')" , "CREATE TABLE author (first_name, last_name, year_of_death)" , "INSERT INTO author VALUES ('William', 'Shakespeare', 1616)" , "INSERT INTO author VALUES ('Bertold', 'Brecht', 1956)" , ] , ) yield ip_session runsql ( ip_session , "DROP TABLE test" ) runsql ( ip_session , "DROP TABLE author" )
Provides an IPython session in which tables have been created
Provides an IPython session in which tables have been created
"""Provides an IPython session in which tables have been created"""