Skip to content

Add basic pytest tests for umdp3_conformance.py#216

Draft
r-sharp wants to merge 18 commits intoMetOffice:mainfrom
r-sharp:rebase_add_basic_tests
Draft

Add basic pytest tests for umdp3_conformance.py#216
r-sharp wants to merge 18 commits intoMetOffice:mainfrom
r-sharp:rebase_add_basic_tests

Conversation

@r-sharp
Copy link
Contributor

@r-sharp r-sharp commented Mar 19, 2026

PR Summary

Sci/Tech Reviewer: @t00sa
Code Reviewer:

Adding tests to test the tester not tests to to test the tests the tester runs.
If these are tests to test the tester, where's the tests to test the tests that test the tester.

A range of pytest unit tests to test section of umdp3-conformance.py.
Some of these were suggested by CoPilot as not only as things that could/should be tested, but CoPilot was also asked to supply the original code to form the tests. (mostly where monkeypatch was involved as I'd never really played with that before).
Particularly in the case of the CoPilot written ones, they work, they seem to go to great lengths to set up objects (real or patched) and then essentially test what are trivial actions/logic in the original code.
As a method of quickly highlighting when changes are made to those objects - great.
As ways of ensuring the code does what you expect - less so. However I think integration testing would be required for most of that, not unit testing.

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • This change has been tested appropriately (please describe)

These tests have been run. They all pass.
They don't affect the actual code, so that hasn't been run in this instance.

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

I used (I believe) GitHub CoPilot (within VSCode) to list the things it thought I should test and to generate some of this code.

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

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