The IsolatedTestsPlugin respects pytest order markers.#256
The IsolatedTestsPlugin respects pytest order markers.#256MikeStitt wants to merge 6 commits intorobotpy:mainfrom
Conversation
|
Thanks for the contribution. There are a bunch of tests now for isolated mode et al, so it would be good to include this as part of that. If you're using AI tooling, please ask your agent to create tests that cover this. If you're not using AI tooling, let me know here and I can have mine generate some tests later this evening/week. |
…ts run in an appropriate order. Signed-off-by: Mike Stitt <mike@stitt.cc>
Signed-off-by: Mike Stitt <mike@stitt.cc>
|
I had claude code write what appears to be reasonable tests of this change to me. But I'm not fully up to speed on the capabilities of the test harness. So someone who's used to this test harness should read the tests. |
virtuald
left a comment
There was a problem hiding this comment.
pytest.mark.order is not a pytest thing, but is provided by the pytest-order plugin? That plugin provides a bunch of different ways to specify ordering, and it's not clear that this fix works for all of them. In particular, there are two cases that I can see aren't handled here:
- pytest-order allows specifying
@pytest.mark.order(after="test_second")to reference a test by name. It's not clear this order is honored here. - You're only inspecting the order marker in the loop where items with a robot fixture are ran in parallel. If an item with a robot fixture depended on an item that didn't have a robot fixture, that ordering wouldn't be honored
Probably we could support all of this, but there should be tests to cover all of the cases.
Additionally, since this functionality only works if pytest-order is installed, that should be added to the test dependencies.
…d testsing. Fix-up requirements.txt.
|
Showed that |
… with the IsolatedTestsPlugin.
|
I created a more complete and robust solution for your consideration. Closing this one. |
When using robotpy test to test a simulated pykit robot and following pykit replay of the robot, it is uselful to run robot tests ordered so that the replay uses the controlled previous run.
This change makes the IsolatedTestsPlugin respect pytest order markers.
-Thanks
-Mike
An example test file that uses the order markers: