labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

added '-s' option in example command

Open bhargavthriler opened this issue 6 years ago • 6 comments

Description The pytest -s option is required to read from stdin.

Checklist

  • [x] PR has been tested

bhargavthriler avatar Jun 06 '19 16:06 bhargavthriler

Codecov Report

Merging #447 (35d79ba) into master (44be6b0) will increase coverage by 4.9%. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #447     +/-   ##
========================================
+ Coverage    56.4%   61.3%   +4.9%     
========================================
  Files         116     135     +19     
  Lines        7161   11339   +4178     
========================================
+ Hits         4039    6958   +2919     
- Misses       3122    4381   +1259     
Impacted Files Coverage Δ
labgrid/util/helper.py 63.1% <0.0%> (-21.6%) :arrow_down:
labgrid/driver/usbloader.py 46.6% <0.0%> (-11.9%) :arrow_down:
labgrid/strategy/shellstrategy.py 41.1% <0.0%> (-8.9%) :arrow_down:
labgrid/driver/quartushpsdriver.py 37.8% <0.0%> (-4.8%) :arrow_down:
labgrid/driver/usbvideodriver.py 28.7% <0.0%> (-4.6%) :arrow_down:
labgrid/driver/onewiredriver.py 87.0% <0.0%> (-3.9%) :arrow_down:
labgrid/driver/serialdigitaloutput.py 50.0% <0.0%> (-3.4%) :arrow_down:
labgrid/util/expect.py 91.6% <0.0%> (-2.5%) :arrow_down:
labgrid/pytestplugin/fixtures.py 63.2% <0.0%> (-2.4%) :arrow_down:
labgrid/util/proxy.py 76.3% <0.0%> (-2.0%) :arrow_down:
... and 87 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 44be6b0...35d79ba. Read the comment docs.

codecov[bot] avatar Jun 06 '19 16:06 codecov[bot]

As the transitions are executed under with capsys.disabled():, the -s switch should not be needed. Is that broken for you?

jluebbe avatar Jun 12 '19 10:06 jluebbe

Yes, see #443

Emantor avatar Jun 12 '19 11:06 Emantor

@Emantor, according to https://docs.pytest.org/en/latest/capture.html#accessing-captured-output-from-a-test-function, it should be possible to disable capturing with capsys.disabled(). If that's broken, we should fix it upstream instead of using -s as a workaround.

jluebbe avatar Jun 12 '19 13:06 jluebbe

pytest-dev/pytest#2189 seems to indicate that we are not alone. Only stdout is not captured, stdin looks to be captured even with capsys.disabled(). I'll look into pytest and determine whether this can be fixed there or we need to have a workaround within labgrid.

Emantor avatar Jun 25 '19 04:06 Emantor

The capsys docs now refer explicitly to stdout/stderr, so we need to document using -s in the example and with ManualPowerDriver under pytest.

jluebbe avatar Jan 25 '21 11:01 jluebbe