You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running unit tests in random order can help uncover hidden dependencies and assumptions within the tests themselves. When tests are run in a predetermined order, it's possible for dependencies between tests or shared state to go unnoticed. Randomizing the order can expose these issues, ensuring that each test is truly independent and capable of standing on its own.
In Python pytest-random-order plugin for pytest provides this functionality.
Feature request
Currently, {testthat} always runs tests in the alphabetical order (except when Config/testthat/start-first is set), and it would be great if it can also provide a way to run the tests in randomized order to detect coupling between different tests.
Not sure about the possible API: It could either be a new function or a parameter to test_dir(), which is then exposed via devtools::test().
The text was updated successfully, but these errors were encountered:
Preamble
Running unit tests in random order can help uncover hidden dependencies and assumptions within the tests themselves. When tests are run in a predetermined order, it's possible for dependencies between tests or shared state to go unnoticed. Randomizing the order can expose these issues, ensuring that each test is truly independent and capable of standing on its own.
In Python
pytest-random-order
plugin forpytest
provides this functionality.Feature request
Currently,
{testthat}
always runs tests in the alphabetical order (except whenConfig/testthat/start-first
is set), and it would be great if it can also provide a way to run the tests in randomized order to detect coupling between different tests.Not sure about the possible API: It could either be a new function or a parameter to
test_dir()
, which is then exposed viadevtools::test()
.The text was updated successfully, but these errors were encountered: