Transfer tests from unittest to pytest
Description
Started to transition tests from unittest to pytest and add new tests.
To run the tests, there are two options, either run for, e.g. the isaaclab test:
./isaaclab.sh -p -m pytest source/isaaclab/test # all tests
./isaaclab.sh -p -m pytest source/isaaclab/test/sensors/test_ray_caster.py # single test
or you can rerun the setup_vscode task which will automatically add two new run options (to either run a single test file or all tests):
TODO:
- test_contact_sensor need cleanup with definition of parameterizations to avoid for loops
- test_tiled_camera_env needs a long time -- is that intended? @kellyguo11
Type of change
- New feature (non-breaking change which adds functionality)
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
- [x] I have run the
pre-commitchecks with./isaaclab.sh --format - [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have updated the changelog and the corresponding version in the extension's
config/extension.tomlfile - [x] I have added my name to the
CONTRIBUTORS.mdor my name already exists there
We should also integrate Pytest-HTML to get a ncier logging of the test failures.
https://github.com/pytest-dev/pytest-html
@kellyguo11 do you know someone who can help check this?
We should also integrate Pytest-HTML to get a ncier logging of the test failures.
https://github.com/pytest-dev/pytest-html
@kellyguo11 do you know someone who can help check this?
I'll keep it on the list, we might not have bandwidth for now though.
Can you comment on how you run these pytests in the description :pray:
@jsmith-bdai thanks for the feedback, all should be adjusted now
@jsmith-bdai thanks for the feedback, all should be adjusted now
@pascal-roth when I try running the ./isaaclab.sh -p -m pytest source/isaaclab/test it fails locally in the docker during discovery due to ValueError: AppLauncer instance exists but enable_cameras is False. When you were testing this out were you operating in the docker?
merged with #2034