petercorke / petercorke/robotics-toolbox-python

Test suite hygiene: collision-checking skip markers, Python 3.10 workaround

Open
#575 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech-debt
Dominant language
C++
Stars
3.5k
Forks
624
Avg merge
2d 4h
Merged PRs (30d)
53

Description

Migrated from tech-debt.md (deleted, see repo history via git log -- tech-debt.md). Small test-suite hygiene items.

  • Audit test_collision.py for missing @skip_no_collision_checking markers. tests/__init__.py provides skip_no_collision_checking so collision tests degrade gracefully when coal isn't installed (e.g. Windows, which has no coal wheel on PyPI). test_ELink.py, test_ERobot.py, test_Robot.py use it correctly; test_collision.py itself doesn't (or not consistently) -- produced 52 hard ImportError failures on Windows CI instead of skips once Windows jobs could reach the Test step at all. Fix: audit test_collision.py's test classes and apply the marker (or an equivalent module-level pytestmark) wherever a test exercises real collision geometry rather than the collision=False guard paths.

  • Remove the Python-3.10-specific sys.modules workaround in test_fknm_fallback.py, once requires-python drops 3.10. tests/test_fknm_fallback.py has a _ETS_module = sys.modules["roboticstoolbox.robot.ETS"] workaround: robot/__init__.py's from ...ETS import ETS shadows the ETS submodule with the ETS class, and Python 3.10's unittest.mock.patch() resolves dotted-string targets via plain getattr (fooled by the shadowing) where 3.11+'s pkgutil.resolve_name-based resolution isn't. Not a real code bug, purely a 3.10 unittest.mock limitation. Python 3.10 reaches EOL October 2026. When requires-python drops 3.10 support, simplify back to plain patch("roboticstoolbox.robot.ETS.ETS_fkine", ...)-style dotted strings, and do a quick sweep for any other sys.version_info/3.10-specific conditionals at the same time so the cleanup happens in one pass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/test_collision.py and compare its test classes with the markers in tests/init.py, test_ELink.py, test_ERobot.py, and test_Robot.py; run the collision tests and confirm unavailable coal produces skips rather than ImportError failures. When Python 3.10 support is dropped, revisit tests/test_fknm_fallback.py, replace the workaround as described, and sweep for related sys.version_info or 3.10 conditionals.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.