labgrid
labgrid copied to clipboard
added '-s' option in example command
Description
The pytest -s option is required to read from stdin.
Checklist
- [x] PR has been tested
Codecov Report
Merging #447 (35d79ba) into master (44be6b0) will increase coverage by
4.9%. The diff coverage isn/a.
@@ 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 dataPowered by Codecov. Last update 44be6b0...35d79ba. Read the comment docs.
As the transitions are executed under with capsys.disabled():, the -s switch should not be needed. Is that broken for you?
Yes, see #443
@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.
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.
The capsys docs now refer explicitly to stdout/stderr, so we need to document using -s in the example and with ManualPowerDriver under pytest.