cmd2 icon indicating copy to clipboard operation
cmd2 copied to clipboard

use pybridge to capture stderr for transcript tests

Open crotwell opened this issue 3 years ago • 4 comments

use pybridge to capture stderr when running transcripts as tests. Think this addresses at least part of #1185, as stderr is part of the comparison. But this does not address outputing stderr when creating a transcript using history -t.

Possible that simple concatenation is not the right way to create the result for comparison, but at least any self.stderr output will be noticed by the test.

crotwell avatar Mar 01 '22 16:03 crotwell

Codecov Report

Base: 98.58% // Head: 98.58% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (65cae71) compared to base (031832a). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1210   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files          22       22           
  Lines        5705     5707    +2     
=======================================
+ Hits         5624     5626    +2     
  Misses         81       81           
Impacted Files Coverage Δ
cmd2/transcript.py 93.10% <100.00%> (+0.12%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Mar 01 '22 19:03 codecov[bot]

@crotwell Phillip, thanks for the PR! Can you please run black to auto-format your changes? That way all of our tests will pass.

@anselor @kmvanbrunt You guys are more familiar with the pybridge stuff than I am, could one of you please review this PR and make sure it won't break any existing known workflows?

tleonhardt avatar Jul 14 '22 13:07 tleonhardt

@crotwell Formatting is still broken due to isort.

I added a new invoke task you can run with inv format which will auto-format code using both black and isort.

tleonhardt avatar Jul 14 '22 17:07 tleonhardt

@kmvanbrunt @anselor Now that all tests are passing, could one or both of you please review this PR?

IMO I don't like that it is only a partial solution. On the other hand, perhaps that is better than no solution?

tleonhardt avatar Jul 14 '22 17:07 tleonhardt

@crotwell Thank you very much for this PR. We appreciate your contribution.

My understanding is that this solution is incomplete and likely not the best long-term approach. This PR has existed for almost a year and I am going to close it now.

If someone would like to work on a more complete and appropriate solution in the future, that would be great.

tleonhardt avatar Jan 28 '23 17:01 tleonhardt