Skip to content

Commit

Permalink
duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
neelasha23 committed Mar 25, 2024
1 parent 13f2c1c commit 949e06f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/tests/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2767,3 +2767,20 @@ def test_disabled_named_parameters_shows_disabled_warning(ip):
)

assert expected_warning in str(excinfo.value)


def test_disabled_named_parameters_shows_disabled_warning_duplicate(ip):
ip.run_cell("%config SqlMagic.named_parameters='disabled'")
query_should_warn = "%sql select json('[{\"a\"::1}')"

with pytest.raises(UsageError) as excinfo:
ip.run_cell(query_should_warn)

expected_warning = (
'The named parameters feature is "disabled". '
'Enable it with: %config SqlMagic.named_parameters="enabled".\n'
"For more info, see the docs: "
"https://jupysql.ploomber.io/en/latest/api/configuration.html"
)

assert expected_warning in str(excinfo.value)

0 comments on commit 949e06f

Please sign in to comment.