Skip to content

fix: pre-existing issues in server.py and common.py (raise_if_dead, has_minimum_version)#641

Open
tony wants to merge 1 commit intomasterfrom
fix/has-minimum-version-cache
Open

fix: pre-existing issues in server.py and common.py (raise_if_dead, has_minimum_version)#641
tony wants to merge 1 commit intomasterfrom
fix/has-minimum-version-cache

Conversation

@tony
Copy link
Copy Markdown
Member

@tony tony commented Mar 8, 2026

Summary

Three pre-existing issues surfaced during a fresh code review of PR #636. This PR addresses them as atomic commits against master.

  • P1 common(fix[has_minimum_version]): has_minimum_version was calling get_version() twice, spawning two subprocesses for no reason. Now cached in a local variable.
  • P2 server(docs[raise_if_dead]): raise_if_dead had no Raises section in its docstring. Both TmuxCommandNotFound (missing binary) and CalledProcessError (server not running) are now documented.
  • P3 server(fix[raise_if_dead]): subprocess.check_call in raise_if_dead inherited the parent process's stdout/stderr, leaking list-sessions output to the terminal. Now redirected to subprocess.DEVNULL.

Test plan

  • uv run ruff check . --fix --show-fixes — clean
  • uv run ruff format . — no changes
  • uv run mypy — no issues (60 source files)
  • uv run py.test -x -q — 885 passed, 1 skipped

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.58%. Comparing base (81d55fa) to head (1cccc1d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #641   +/-   ##
=======================================
  Coverage   46.58%   46.58%           
=======================================
  Files          22       22           
  Lines        2372     2372           
  Branches      390      390           
=======================================
  Hits         1105     1105           
  Misses       1098     1098           
  Partials      169      169           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: subprocess.check_call without stdout/stderr redirection inherits the
     parent process's file descriptors, printing tmux output directly to
     the terminal. Library code should not produce terminal noise.
what:
- Pass stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL to check_call
@tony tony force-pushed the fix/has-minimum-version-cache branch from cd81d15 to 1cccc1d Compare April 26, 2026 10:25
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.

1 participant