Skip to content

Fix device_each to skip instead of fail when no matching device#14866

Merged
Nir-Az merged 1 commit intorealsenseai:developmentfrom
Nir-Az:fix-device-each-skip
Mar 26, 2026
Merged

Fix device_each to skip instead of fail when no matching device#14866
Nir-Az merged 1 commit intorealsenseai:developmentfrom
Nir-Az:fix-device-each-skip

Conversation

@Nir-Az
Copy link
Copy Markdown
Collaborator

@Nir-Az Nir-Az commented Mar 25, 2026

Summary

  • PR Fail tests instead of skipping when required device is missing #14854 changed pytest.skip to pytest.fail when a required device is missing, which is correct for device() marker
  • But it also affected device_each() which should skip when no matching device exists (e.g. D585S on a Jetson with only D401)
  • Fix: only pytest.fail when a device() marker is present; device_each()-only tests skip gracefully

Test plan

  • pytest-ah-configurations.py (device_each D585S) skips when no D585S connected
  • pytest-backend-vs-frame-timestamp.py (device D400*) fails when no D400 connected

Copilot AI review requested due to automatic review settings March 25, 2026 21:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts device-resolution behavior in the unit-test pytest plugin so device_each()-only tests skip (not fail) when no matching hardware is connected, while preserving the stricter “missing required device == fail” behavior for device().

Changes:

  • Detect whether a device() marker is present when no devices match.
  • pytest.fail only when device() is present; otherwise pytest.skip for device_each()-only cases.
  • Keeps the existing “all matching devices excluded” case as a skip.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nir-Az Nir-Az merged commit c524902 into realsenseai:development Mar 26, 2026
30 of 31 checks passed
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.

2 participants