labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

labgrid: pytestplugin: hooks: fix multiple start stop for StepLogger

Open jremmet opened this issue 1 year ago • 1 comments

pytests pytester can be used to run pytests inside pytest. This results in nested calls of pytest_configure and so multiple starts and stops of the StepLogger.

Only start StepLogger if it is not already active. This solution will run the cleanup hook in the "outer" pytest instance.

fixes #1468

Checklist

  • [ ] Documentation for the feature
  • [ ] Tests for the feature
  • [ ] The arguments and description in doc/configuration.rst have been updated
  • [ ] Add a section on how to use the feature to doc/usage.rst
  • [ ] Add a section on how to use the feature to doc/development.rst
  • [x] PR has been tested
  • [ ] Man pages have been regenerated

jremmet avatar Aug 13 '24 14:08 jremmet

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 55.8%. Comparing base (6962ac5) to head (af2eadd).

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1474   +/-   ##
======================================
  Coverage    55.8%   55.8%           
======================================
  Files         170     170           
  Lines       13380   13381    +1     
======================================
+ Hits         7469    7470    +1     
  Misses       5911    5911           
Flag Coverage Δ
3.10 55.8% <100.0%> (+<0.1%) :arrow_up:
3.11 55.8% <100.0%> (+<0.1%) :arrow_up:
3.12 55.8% <100.0%> (+<0.1%) :arrow_up:
3.13 55.7% <100.0%> (+<0.1%) :arrow_up:
3.9 55.8% <100.0%> (+<0.1%) :arrow_up:

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

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

codecov[bot] avatar Feb 20 '25 10:02 codecov[bot]