Skip to content

Migrate test-motion.py to pytest - #15317

Merged
Nir-Az merged 5 commits into
realsenseai:developmentfrom
Nir-Az:migrate-pytest-motion
Jul 2, 2026
Merged

Nir-Az merged 5 commits into
realsenseai:developmentfrom
Nir-Az:migrate-pytest-motion

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Jun 29, 2026 •

Copy link
Copy Markdown
Collaborator

Overview: Migrates the motion-intrinsics live test (accel/gyro/combined-motion profiles) to native pytest.

Tracked on [RSDSO-21677]

Why

Part of the ongoing effort to move legacy test-*.py scripts to native pytest-*.py.

Summary

  • git mv test-motion.py pytest-motion-intrinsics.py (history preserved). Named pytest-motion-intrinsics.py, not pytest-motion.py, to avoid a module-name collision with the existing unit-tests/sw-dev/pytest-motion.py (pytest derives the module name from the basename; two pytest-motion.py files abort collection).
  • Wrapped the script in def test_motion_intrinsics(test_device); uses the test_device fixture instead of test.find_first_device_or_exit().
  • # test:donotrun:!weekly → pytest.mark.context("weekly").
  • Platform-conditional device markers rebuilt at module load via is_jetson_platform(), using device_each so a bench lacking the device skips instead of failing (matches pytest-mipi-motion.py / pytest-intra-camera-sync.py):
    • Jetson → device_each("D457")
    • non-Jetson → device_each("D455") + device_each("D500*")
  • from rspy import test, log → stdlib logging; log.d → log.debug.
  • test.check(motion_sensor) precondition → assert; remaining test.check → pytest_check.check.is_true. Dropped test.start/finish/print_results_and_exit.

Test plan

  • LibCI weekly -r motion: test_motion_intrinsics PASSED on D455, D555, D585S (Linux + Windows) and D457 (Jetson JP5).
  • Jetson JP6 (rs-ci-orin-04, no D457) now skips via device_each instead of erroring.
  • Collection no longer collides with sw-dev/pytest-motion.py.

🤖 Generated by AI

@Nir-Az
Nir-Az requested a review from remibettan June 30, 2026 12:12
@Nir-Az
Nir-Az requested review from OhadMeir and removed request for remibettan June 30, 2026 14:00

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 rs-agentic automated review — reviewing the latest push (Simplify device markers to inline device_each, keep D500-series coverage).

The simplification of the block using the inline ternary is cleaner and consistent with the pattern OhadMeir suggested 👍. A few additional observations below (inline).

@Nir-Az
Nir-Az merged commit e1c5c21 into realsenseai:development Jul 2, 2026
29 checks passed
@Nir-Az
Nir-Az deleted the migrate-pytest-motion branch July 2, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants