Skip to content

Update rainforests tests to run only when required modules are present#2349

Open
benowen-bom wants to merge 2 commits into
metoppv:masterfrom
benowen-bom:add_import_checks_on_acc_test
Open

Update rainforests tests to run only when required modules are present#2349
benowen-bom wants to merge 2 commits into
metoppv:masterfrom
benowen-bom:add_import_checks_on_acc_test

Conversation

@benowen-bom

@benowen-bom benowen-bom commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Addresses #2348.

A number of acceptance tests fail due to missing imports. This PR adds import skips to the specific tests that are failing to ensure the run only when the required module is present.

This also adds a change to the test_apply_rainforests_calibration that moves the import from module level to function level to ensure that the tests are listed in pytest run as skips.

Need to fix failing test on the conda-forge environment
The failing test is unrelated to the fix in this PR. I've opened another ticket on this issue; see #2351.

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

@benowen-bom benowen-bom changed the title WIP: Update tests to run only when required modules are present Update tests to run only when required modules are present Apr 2, 2026
@benowen-bom benowen-bom added the MO review required PRs opened by non-Met Office developers that require a Met Office review label Apr 2, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

In order to maintain a backlog of relevant PRs, we automatically label them as stale after 60 days of inactivity.

If this PR is still important to you, then please comment on this PR and the stale label will be removed.

Otherwise this PR will be automatically closed in 30 days time.

@github-actions github-actions Bot added the Stale label Jun 1, 2026
@gavinevans gavinevans removed the Stale label Jun 9, 2026
@MoseleyS MoseleyS changed the title Update tests to run only when required modules are present Update rainforests tests to run only when required modules are present Jun 22, 2026

@jdjonathandavies jdjonathandavies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This is my first review on the IMPROVER repo. I have:

  • Read the code and didn't feel the need to post any in-line comments for suggested alterations
  • Ensured that the unit tests ran
  • Ensured that the acceptance tests also ran
  • The Acceptance Criteria have been met
  • The definition of DONE is satisfied
  • The testing on the issue is clear

Details of checks

In order to check that the PR addresses the issue of tests being marked as skipped when libraries are missing I have:

  • Checked out the branch
  • Rebased it onto the latest master
  • Updated my local checkout of improver_test_data
  • Ran the tests (which passed)
  • Edited the changed files to request libraries that don't exist
  • Re-ran tests and confirmed that they all skip in that circumstance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MO review required PRs opened by non-Met Office developers that require a Met Office review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants