Skip to content

Commit

Permalink
testing column names are visible. closes #50
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Dec 31, 2022
1 parent b51d9e3 commit 0ea506f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def ip():
"CREATE TABLE author (first_name, last_name, year_of_death)",
"INSERT INTO author VALUES ('William', 'Shakespeare', 1616)",
"INSERT INTO author VALUES ('Bertold', 'Brecht', 1956)",
"CREATE TABLE empty_table (column INT, another INT)",
],
)
yield ip_session
Expand Down
7 changes: 7 additions & 0 deletions src/tests/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ def test_close_connection(ip, tmp_empty):
assert "sqlite:///two.db" not in Connection.connections


def test_column_names_visible(ip, tmp_empty):
res = ip.run_line_magic("sql", "SELECT * FROM empty_table")

assert "<th>column</th>" in res._repr_html_()
assert "<th>another</th>" in res._repr_html_()


@pytest.mark.xfail(reason="known parse @ parser.py error")
def test_sqlite_path_with_spaces(ip, tmp_empty):
ip.run_cell("%sql sqlite:///some database.db")
Expand Down

0 comments on commit 0ea506f

Please sign in to comment.