Summary
SeleniumTestMixin._setup_and_call() crashes under Django's parallel test runner when a Selenium test is skipped.
The current skip handling added in openwisp-utils#570 iterates result.skipped, but Django's RemoteTestResult sets skipped to a truthy DummyList, which is not iterable.
Steps to reproduce
- Run a skipped Selenium test through Django's parallel runner.
- Let the test reach
SeleniumTestMixin._setup_and_call().
Current behavior
The test run crashes in openwisp_utils/tests/selenium.py with:
TypeError: 'DummyList' object is not iterable
at:
for _, reason in result.skipped:
Expected behavior
Skipped Selenium tests should still be reported as skipped under Django's parallel runner, without crashing the test run.
Root cause
For Django's parallel runner, the result object is RemoteTestResult:
result.skipped is a DummyList
DummyList is truthy but not iterable
- actual skip events are recorded in
result.events
So the current logic works for standard unittest results, but not for RemoteTestResult.
Proposed fix
- read skip reasons from
result.events when the result object exposes events
- fall back to iterating
result.skipped for standard results
This preserves the behavior added in #570 for serial runs and fixes the parallel case.
Summary
SeleniumTestMixin._setup_and_call()crashes under Django's parallel test runner when a Selenium test is skipped.The current skip handling added in
openwisp-utils#570iteratesresult.skipped, but Django'sRemoteTestResultsetsskippedto a truthyDummyList, which is not iterable.Steps to reproduce
SeleniumTestMixin._setup_and_call().Current behavior
The test run crashes in
openwisp_utils/tests/selenium.pywith:at:
Expected behavior
Skipped Selenium tests should still be reported as skipped under Django's parallel runner, without crashing the test run.
Root cause
For Django's parallel runner, the result object is
RemoteTestResult:result.skippedis aDummyListDummyListis truthy but not iterableresult.eventsSo the current logic works for standard unittest results, but not for
RemoteTestResult.Proposed fix
result.eventswhen the result object exposeseventsresult.skippedfor standard resultsThis preserves the behavior added in
#570for serial runs and fixes the parallel case.