Skip to content

tests: avoid shell parsing in CLI helper#2865

Open
kuishou68 wants to merge 1 commit intosherlock-project:masterfrom
kuishou68:tests/2864-argv-cli-helper
Open

tests: avoid shell parsing in CLI helper#2865
kuishou68 wants to merge 1 commit intosherlock-project:masterfrom
kuishou68:tests/2864-argv-cli-helper

Conversation

@kuishou68
Copy link
Copy Markdown

Summary

  • stop building a shell command string in tests/sherlock_interactives.py
  • invoke the CLI helper via sys.executable -m sherlock_project with an argv list
  • preserve stderr capture and the existing CalledProcessError -> InteractivesSubprocessError flow

Why

Using shell=True here makes the helper depend on shell parsing and quoting behavior instead of direct CLI argument handling. An argv-based call is safer, easier to reason about, and more faithful to how the tests want to exercise the CLI.

Self-review

  • kept the change scoped to the interactive test helper only
  • used shlex.split(...) so existing string-based test inputs still map onto argv cleanly
  • used sys.executable to avoid relying on a separate sherlock or py shell command being present on PATH

Closes #2864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: avoid shell=True in interactive CLI helper

1 participant