Skip to content

Commit e9dc8c7

Browse files
authored
Use reliable path to python interpreter in cli test (#678)
1 parent 35ce9b7 commit e9dc8c7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/test_wordcloud_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
import os
33
import subprocess
4+
import sys
45
from collections import namedtuple
56
import contextlib
67

@@ -183,8 +184,8 @@ def test_cli_regexp_invalid(tmp_text_file, capsys):
183184

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

0 commit comments

Comments
 (0)