From 9306ff777e472c140f6b418f1bf953be058c41e7 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Thu, 9 Jan 2025 16:34:39 +0000 Subject: [PATCH] Normalise schema spelling when comparing graphql-core 3.2.5 changed the spelling of 'behaviour' to the US English version 'behavior'. Normalise the (hardcoded) expected and generated values to allow for either spelling. --- tests/main/test_main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/main/test_main.py b/tests/main/test_main.py index 3cf9f1d..e912f54 100644 --- a/tests/main/test_main.py +++ b/tests/main/test_main.py @@ -367,4 +367,11 @@ def test_main_generates_correct_schema_file(project_dir, file_name, expected_fil assert result.exit_code == 0 schema_path = project_dir / file_name - assert schema_path.read_text() == expected_file_path.read_text() + # normalise texts to account for a spelling change in graphql-core 3.2.5 + def normalise(schema: str) -> str: + return schema.replace(" behaviour ", " behavior ") + + actual = normalise(schema_path.read_text()) + expected = normalise(expected_file_path.read_text()) + + assert actual == expected