shtab icon indicating copy to clipboard operation
shtab copied to clipboard

test: capture stdout/stderr in Bash.test helper

Open ThomasWaldmann opened this issue 1 month ago • 2 comments

Previously, the Bash.test helper did not capture stdout or stderr, causing them to be None. This meant that the assertion not stdout was always true (vacuously), and if a test failed, the error message contained no output.

Changed the assertion and also the assertion failure message to not hide the "None/None" issue.

This commit adds output capturing to subprocess.Popen and decodes it as utf-8, ensuring that test failures provide useful debugging information.

ThomasWaldmann avatar Nov 19 '25 18:11 ThomasWaldmann

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 89.18%. Comparing base (fe5f177) to head (201bf5c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #209   +/-   ##
=======================================
  Coverage   89.18%   89.18%           
=======================================
  Files           3        3           
  Lines         370      370           
=======================================
  Hits          330      330           
  Misses         40       40           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Nov 19 '25 18:11 codecov[bot]

Brought to you by google antigravity. :-)

ThomasWaldmann avatar Nov 19 '25 18:11 ThomasWaldmann