Skip to content

LifeLineChartView: bare Exception on missing pip dep causes pytest collection crash #57

Description

@eduralph

Summary

LifeLineChartView raises a bare Exception (rather than ImportError) when the life_line_chart pip package is absent. The pytest collection guard only catches ImportError, so the bare Exception propagates to the collection phase and registers as a collection crash — appearing as LifeLineChartView.collection::import_or_collection in T3 addon-unit results.

This has surfaced as a recurring T3 delta across multiple Gramps Testbed bundles (issue_5965, issue_6988, issue_7832), always in the gramps60 matrix leg.

Location

Approximately lifelinechart.py line ~75 — the raise Exception(...) statement when the life_line_chart package import fails.

Suggested fix

Change raise Exception(...) to raise ImportError(...) at the missing-dependency guard, so pytest's ImportError collector guard fires and the test module is cleanly skipped rather than crashing collection.

Alternatively, guard the addon's module-level import with a try/except and use unittest.skip / SkipTest to produce a clean, informative skip.

Context

Identified via cross-cycle Act review of the Gramps Testbed v2 PDCA harness (act-log 2026-06-27). Related pattern: every addon that catches a missing-dependency ImportError at module level and re-raises as a bare Exception (or silently logs and leaves names undefined) causes a collection crash instead of a clean skip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions