Skip to content

Commit

Permalink
cleaning up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Dec 31, 2022
1 parent f83f5ce commit b51d9e3
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/tests/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,27 +186,20 @@ def test_displaylimit_disabled(ip, value):
ip.run_line_magic("config", "SqlMagic.autolimit = None")

ip.run_line_magic("config", f"SqlMagic.displaylimit = {value}")
result = runsql(
ip,
"SELECT * FROM (VALUES ('apple'), ('banana'), ('cherry')) "
"AS Result ORDER BY 1;",
)
assert "apple" in result._repr_html_()
assert "banana" in result._repr_html_()
assert "cherry" in result._repr_html_()
result = runsql(ip, "SELECT * FROM author;")

assert "Brecht" in result._repr_html_()
assert "Shakespeare" in result._repr_html_()


def test_displaylimit(ip):
ip.run_line_magic("config", "SqlMagic.autolimit = None")

ip.run_line_magic("config", "SqlMagic.displaylimit = 1")
result = runsql(
ip,
"SELECT * FROM (VALUES ('apple'), ('banana'), ('cherry')) "
"AS Result ORDER BY 1;",
)
assert "apple" in result._repr_html_()
assert "cherry" not in result._repr_html_()
result = runsql(ip, "SELECT * FROM author ORDER BY first_name;")

assert "Brecht" in result._repr_html_()
assert "Shakespeare" not in result._repr_html_()


def test_column_local_vars(ip):
Expand Down

0 comments on commit b51d9e3

Please sign in to comment.