Skip to content

Fix "Fast tests (core only)" CI failure: skip gpflow-dependent tests when gpflow is unavailable - #1

Merged
adowling2 merged 2 commits into
mainfrom
copilot/fix-fast-tests-core-only-python-3-9
Aug 17, 2026
Merged

Fix "Fast tests (core only)" CI failure: skip gpflow-dependent tests when gpflow is unavailable#1
adowling2 merged 2 commits into
mainfrom
copilot/fix-fast-tests-core-only-python-3-9

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

The core-only CI job (.[dev] install, no gpflow extra) was failing at test collection because test_fake_gp_backend.py imported GpflowBackend at module level, which unconditionally executes import gpflow inside gpflow_backend.py.

Change

Added pytest.importorskip at module level to skip the entire file when gpflow is not installed, and moved the GpflowBackend import to after it:

# Before – unconditional top-level import caused collection error:
from emcal.gp_backend.gpflow_backend import GpflowBackend  # → ModuleNotFoundError

# After – module is skipped gracefully when gpflow is absent:
gpflow = pytest.importorskip("gpflow", reason="gpflow not installed")
from emcal.gp_backend.gpflow_backend import GpflowBackend

The full test suite (gpflow job) is unaffected — all tests in the file still run when gpflow is present.

Co-authored-by: adowling2 <13946870+adowling2@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Fast tests (core only), Python 3.9 Fix "Fast tests (core only)" CI failure: skip gpflow-dependent tests when gpflow is unavailable Aug 17, 2026
Copilot AI requested a review from adowling2 August 17, 2026 12:38
@adowling2
adowling2 marked this pull request as ready for review August 17, 2026 13:11
@adowling2
adowling2 merged commit 8396982 into main Aug 17, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants