Skip to content

Commit

Permalink
Use reliable path to python interpreter in cli test (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 authored Apr 26, 2022
1 parent 35ce9b7 commit e9dc8c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test_wordcloud_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import os
import subprocess
import sys
from collections import namedtuple
import contextlib

Expand Down Expand Up @@ -183,8 +184,8 @@ def test_cli_regexp_invalid(tmp_text_file, capsys):

@pytest.mark.parametrize("command,expected_output, expected_exit_code", [
("wordcloud_cli --help", "usage: wordcloud_cli", 0),
("python -m wordcloud --help", "usage: __main__", 0),
("python %s/../wordcloud/wordcloud_cli.py --help" % os.path.dirname(__file__), "To execute the CLI", 1),
("%s -m wordcloud --help" % sys.executable, "usage: __main__", 0),
("%s %s/../wordcloud/wordcloud_cli.py --help" % (sys.executable, os.path.dirname(__file__)), "To execute the CLI", 1),
])
def test_cli_as_executable(command, expected_output, expected_exit_code, tmpdir, capfd, no_cover_compat):

Expand Down

0 comments on commit e9dc8c7

Please sign in to comment.