Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jremmet
Copy link
Contributor

@jremmet jremmet commented Aug 13, 2024

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
  • PR has been tested
  • Man pages have been regenerated

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.

Signed-off-by: Jan Remmet <[email protected]>
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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

✅ 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%) ⬆️
3.11 55.8% <100.0%> (+<0.1%) ⬆️
3.12 55.8% <100.0%> (+<0.1%) ⬆️
3.13 55.7% <100.0%> (+<0.1%) ⬆️
3.9 55.8% <100.0%> (+<0.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v24.0 StepLogger may be started twice which results in errors.
3 participants