Skip to content

Commit

Permalink
Fix IPython test warning about deprecated magic
Browse files Browse the repository at this point in the history
IPython would complain about:

    DeprecationWarning: `magic(...)` is deprecated since IPython 0.13
    (warning added in 8.1), use run_line_magic(magic_name, parameter_s).
  • Loading branch information
bbc2 committed Nov 12, 2022
1 parent cadf4fc commit c22bc50
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def test_ipython_existing_variable_no_override(tmp_path):
os.environ["a"] = "c"

ipshell = InteractiveShellEmbed()
ipshell.magic("load_ext dotenv")
ipshell.magic("dotenv")
ipshell.run_line_magic("load_ext", "dotenv")
ipshell.run_line_magic("dotenv", "")

assert os.environ == {"a": "c"}

Expand All @@ -33,8 +33,8 @@ def test_ipython_existing_variable_override(tmp_path):
os.environ["a"] = "c"

ipshell = InteractiveShellEmbed()
ipshell.magic("load_ext dotenv")
ipshell.magic("dotenv -o")
ipshell.run_line_magic("load_ext", "dotenv")
ipshell.run_line_magic("dotenv", "-o")

assert os.environ == {"a": "b"}

Expand All @@ -48,7 +48,7 @@ def test_ipython_new_variable(tmp_path):
os.chdir(str(tmp_path))

ipshell = InteractiveShellEmbed()
ipshell.magic("load_ext dotenv")
ipshell.magic("dotenv")
ipshell.run_line_magic("load_ext", "dotenv")
ipshell.run_line_magic("dotenv", "")

assert os.environ == {"a": "b"}

0 comments on commit c22bc50

Please sign in to comment.