From 0ea506fb3a00d174fd55fb76d0a28a32376f1606 Mon Sep 17 00:00:00 2001 From: Eduardo Blancas Date: Fri, 30 Dec 2022 19:11:20 -0600 Subject: [PATCH] testing column names are visible. closes #50 --- src/tests/conftest.py | 1 + src/tests/test_magic.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/tests/conftest.py b/src/tests/conftest.py index 18480da47..a743eabdb 100644 --- a/src/tests/conftest.py +++ b/src/tests/conftest.py @@ -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 diff --git a/src/tests/test_magic.py b/src/tests/test_magic.py index 4dcc790e0..fe5850a2a 100644 --- a/src/tests/test_magic.py +++ b/src/tests/test_magic.py @@ -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 "column" in res._repr_html_() + assert "another" 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")