Skip to content

Commit

Permalink
test for --version argument
Browse files Browse the repository at this point in the history
  • Loading branch information
smithdc1 committed Feb 24, 2020
1 parent 95b8eab commit 8191601
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from hypothesis_auto import auto_pytest_magic

from isort import main
from isort._version import __version__
from isort.settings import DEFAULT_CONFIG

auto_pytest_magic(main.sort_imports)
Expand All @@ -25,6 +26,27 @@ def test_is_python_file():
assert not main.is_python_file("file.pex")


def test_ascii_art(capsys):
main.main(["--version"])
out, error = capsys.readouterr()
assert (
out
== f"""
_ _
(_) ___ ___ _ __| |_
| |/ _/ / _ \\/ '__ _/
| |\\__ \\/\\_\\/| | | |_
|_|\\___/\\___/\\_/ \\_/
isort your imports, so you don't have to.
VERSION {__version__}
"""
)
assert error == ""


@pytest.mark.skipif(sys.platform == "win32", reason="cannot create fifo file on Windows platform")
def test_is_python_file_fifo(tmpdir):
fifo_file = os.path.join(tmpdir, "fifo_file")
Expand Down

0 comments on commit 8191601

Please sign in to comment.