petercorke / petercorke/robotics-toolbox-python
Test suite hygiene: collision-checking skip markers, Python 3.10 workaround
Nobody has claimed this yet.
- 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.pyfor missing@skip_no_collision_checkingmarkers.tests/__init__.pyprovidesskip_no_collision_checkingso collision tests degrade gracefully whencoalisn't installed (e.g. Windows, which has nocoalwheel on PyPI).test_ELink.py,test_ERobot.py,test_Robot.pyuse it correctly;test_collision.pyitself doesn't (or not consistently) -- produced 52 hardImportErrorfailures on Windows CI instead of skips once Windows jobs could reach the Test step at all. Fix: audittest_collision.py's test classes and apply the marker (or an equivalent module-levelpytestmark) wherever a test exercises real collision geometry rather than thecollision=Falseguard paths. -
Remove the Python-3.10-specific
sys.modulesworkaround intest_fknm_fallback.py, oncerequires-pythondrops 3.10.tests/test_fknm_fallback.pyhas a_ETS_module = sys.modules["roboticstoolbox.robot.ETS"]workaround:robot/__init__.py'sfrom ...ETS import ETSshadows theETSsubmodule with theETSclass, and Python 3.10'sunittest.mock.patch()resolves dotted-string targets via plaingetattr(fooled by the shadowing) where 3.11+'spkgutil.resolve_name-based resolution isn't. Not a real code bug, purely a 3.10unittest.mocklimitation. Python 3.10 reaches EOL October 2026. Whenrequires-pythondrops 3.10 support, simplify back to plainpatch("roboticstoolbox.robot.ETS.ETS_fkine", ...)-style dotted strings, and do a quick sweep for any othersys.version_info/3.10-specific conditionals at the same time so the cleanup happens in one pass.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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