Skip to content

Conversation

@mary-cleaton
Copy link
Contributor

Description

Use mocking to add a new unit test for get_match_scores, since this calls two child functions which each already have a unit test. Whilst doing this, also tweaked test_assign_weights so that its inputs and outputs are defined in a new conftest.py scripts and can be called by both test_assign_weights and test_get_match_scores.

closes #35

Type of change

You can delete options that are not relevant.

  • Bug fix - non-breaking change
  • New feature - non-breaking change
  • Breaking change - backwards incompatible change, changes expected behaviour
  • Non-user facing change, structural change, dev functionality, docs ...

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code appropriately, focusing on explaining my design decisions (explain why, not how).
  • I have made corresponding changes to the documentation (comments, docstring, etc.. )
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have updated the change log.

Peer review

Any new code includes all the following:

  • Documentation: docstrings, comments have been added/ updated.
  • Style guidelines: New code conforms to the project's contribution guidelines.
  • Functionality: The code works as expected, handles expected edge cases and exceptions are handled appropriately.
  • Complexity: The code is not overly complex, logic has been split into appropriately sized functions, etc..
  • Test coverage: Unit tests cover essential functions for a reasonable range of inputs and conditions. Added and existing tests pass on my machine.

Review comments

Suggestions should be tailored to the code that you are reviewing. Provide context.
Be critical and clear, but not mean. Ask questions and set actions.

These might include:
  • bugs that need fixing (does it work as expected? and does it work with other code
    that it is likely to interact with?)
  • alternative methods (could it be written more efficiently or with more clarity?)
  • documentation improvements (does the documentation reflect how the code actually works?)
  • additional tests that should be implemented
    • Do the tests effectively assure that it
      works correctly? Are there additional edge cases/ negative tests to be considered?
  • code style improvements (could the code be written more clearly?)

Further reading: code review best practices

To do this, move some aspects of test_assign_weights to a new conftest.py script for the match_scores module.
@mary-cleaton mary-cleaton requested a review from a team October 28, 2025 15:00
@mary-cleaton mary-cleaton self-assigned this Oct 28, 2025
@mary-cleaton mary-cleaton requested a review from a team as a code owner October 28, 2025 15:00
@mary-cleaton mary-cleaton added python Pull requests that update python code pyspark Pull requests that update pyspark code technical debt Known bug or other problem from backlog labels Oct 28, 2025
@mary-cleaton mary-cleaton linked an issue Oct 28, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pyspark Pull requests that update pyspark code python Pull requests that update python code technical debt Known bug or other problem from backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test: match_scores: get_match_scores

2 participants