Skip to content

Conversation

@bhargavthriler
Copy link

@bhargavthriler bhargavthriler commented Jun 6, 2019

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

Checklist

  • PR has been tested
@codecov
Copy link

codecov bot commented Jun 6, 2019

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.1%. Comparing base (cf3b5ab) to head (55cc233).
��️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #447   +/-   ##
======================================
  Coverage    45.1%   45.1%           
======================================
  Files         172     172           
  Lines       13617   13617           
======================================
  Hits         6143    6143           
  Misses       7474    7474           
Flag Coverage Δ
3.10 45.1% <ø> (ø)
3.11 45.1% <ø> (ø)
3.12 45.1% <ø> (ø)
3.13 45.0% <ø> (ø)
3.14 45.0% <ø> (ø)
3.9 45.1% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jluebbe
Copy link
Member

jluebbe commented Jun 12, 2019

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

@Emantor
Copy link
Member

Emantor commented Jun 12, 2019

Yes, see #443

@jluebbe
Copy link
Member

jluebbe commented Jun 12, 2019

@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.

@Emantor
Copy link
Member

Emantor commented Jun 25, 2019

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.

@jluebbe
Copy link
Member

jluebbe commented Jan 25, 2021

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 jluebbe reopened this Jan 25, 2021
…er/ManualSwitchDriver

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
@Bastian-Krause Bastian-Krause merged commit 916b01a into labgrid-project:master Jan 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants