Skip to content

Conversation

@Paul-Joel
Copy link
Contributor

Motivation and Context

Changes enable the COPYPASTE megalinter checks, and resolve flagged issues

What has changed

Code changes to remove various code duplication issues in test files.

How to test?

Ensure that tests, linters and megalinter checks all pass

Links

EQS-563

@Paul-Joel Paul-Joel requested a review from a team as a code owner January 28, 2026 13:09
"code": "1e",
},

def base_additional_answer_codes():
Copy link
Contributor

Choose a reason for hiding this comment

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

Simpler to just have a const list instead of function and removing the "base" since those are just "additional answer codes"?


def test_duplicate_answer_codes():
filename = "schemas/valid/test_answer_codes.json"
def base_checkbox_answer_codes():
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simplify it and call it "checkbox_answer_codes"?


expected_error_messages = [
{
"message": CalculatedSummaryBlockValidator.ANSWERS_MUST_HAVE_SAME_TYPE,
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to these 3 errors below? Have they been removed?

json_to_validate = _open_and_load_schema_file(filename)

expected_error_messages = [
def base_error_messages():
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer if we follow the convention in the codebase and define it as a top-level constant variable, using uppercase letters (this is just a convention, not enforced). Also, there is only one error message here and not sure if it should be called "base"? It's specific error: "answer same type error message".

)
from tests.utils import _open_and_load_schema_file

radio_answers = [
Copy link
Contributor

@petechd petechd Jan 30, 2026

Choose a reason for hiding this comment

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

Can we make these constants (uppercase names)? Since they are top level?

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.

3 participants