Skip to content

test_tiered_execution_optimization fails with ModuleNotFoundError due to incorrect patch target #869

@shiwani42

Description

@shiwani42

What is the issue?

test_tiered_execution_optimization in gap_analysis_db_test.py errors with ModuleNotFoundError because patch("application.config.Config.GAP_ANALYSIS_OPTIMIZED") treats Config as a submodule of application.config. Config is a class, not a subpackage, so the mock importer fails. The test can never run, leaving the tiered gap analysis optimization feature with no test coverage.

Expected Behaviour

The test should run and verify that Tier 3 is skipped when Tier 1 returns results.

Actual Behaviour

ModuleNotFoundError: No module named 'application.config.Config'; 'application.config' is not a package

Steps to reproduce

  1. Run the test suite: flask test
  2. Observe the error on test_tiered_execution_optimization in gap_analysis_db_test.py

Metadata

Metadata

Assignees

No one assigned

    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