Skip to content

Commit

Permalink
Merge pull request #282 from Carreau/test-281
Browse files Browse the repository at this point in the history
Add passing test for #281
  • Loading branch information
Carreau authored Jan 23, 2024
2 parents c7aa87d + 5d06d73 commit ce60fb4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_imports2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,18 @@ def test_replace_star_no_imports_found(capsys):
captured = capsys.readouterr()
assert 'Traceback' not in captured.err


def test_replace_star_imports_os_issue_281(capsys):
input = PythonBlock(dedent('''
from os import *
getcwd()
''').lstrip(), filename="/foo/test_replace_os_imports.py")
_ = replace_star_imports(input)
captured = capsys.readouterr()
assert 'with' in captured.out and 'imports' in captured.out


def test_replace_star_imports_1():
input = PythonBlock(dedent('''
from mod1 import f1
Expand Down

0 comments on commit ce60fb4

Please sign in to comment.