Skip to content

[bug] SeleniumTestMixin skip handling crashes under Django parallel runner #619

@czarflix

Description

@czarflix

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

  1. Run a skipped Selenium test through Django's parallel runner.
  2. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions