From c6565368a8cc068075643f11e7f42938d0c787d1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:01:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/hatch.toml | 2 +- .../tests/component_library/test_component_library.py | 4 ++-- vizro-core/tests/helpers/common.py | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/vizro-core/hatch.toml b/vizro-core/hatch.toml index da92b5d9c..0cecae8be 100644 --- a/vizro-core/hatch.toml +++ b/vizro-core/hatch.toml @@ -55,8 +55,8 @@ schema-check = ["python schemas/generate.py --check"] # fix this, but we don't actually use `hatch run test` anywhere right now. # See comments added in https://github.com/mckinsey/vizro/pull/444. test = "pytest tests --headless {args}" -test-integration = "pytest tests/integration --headless {args}" test-component-library = "pytest tests/component_library --headless {args}" +test-integration = "pytest tests/integration --headless {args}" test-js = "./tools/run_jest.sh {args}" test-unit = "pytest tests/unit {args}" test-unit-coverage = [ diff --git a/vizro-core/tests/component_library/test_component_library.py b/vizro-core/tests/component_library/test_component_library.py index cc8b23d98..a41a613e4 100644 --- a/vizro-core/tests/component_library/test_component_library.py +++ b/vizro-core/tests/component_library/test_component_library.py @@ -3,10 +3,10 @@ import pandas as pd import pytest from dash import Dash, html -from vizro.figures.library import kpi_card, kpi_card_reference - from tests.helpers.common import compare_images +from vizro.figures.library import kpi_card, kpi_card_reference + df_kpi = pd.DataFrame( { "Actual": [100, 200, 700], diff --git a/vizro-core/tests/helpers/common.py b/vizro-core/tests/helpers/common.py index 3ad032a57..5da5b1441 100644 --- a/vizro-core/tests/helpers/common.py +++ b/vizro-core/tests/helpers/common.py @@ -10,9 +10,7 @@ def comparison_logic(original_image, new_image): difference = cv2.subtract(original_image, new_image) blue, green, red = cv2.split(difference) assert_that(cv2.countNonZero(blue), equal_to(0), reason="Blue channel is different") - assert_that( - cv2.countNonZero(green), equal_to(0), reason="Green channel is different" - ) + assert_that(cv2.countNonZero(green), equal_to(0), reason="Green channel is different") assert_that(cv2.countNonZero(red), equal_to(0), reason="Red channel is different") @@ -47,4 +45,4 @@ def compare_images(browserdriver, base_image, test_image_name): raise Exception("pictures are not the same") from exp except cv2.error as exp: subprocess.call(f"cp {test_image_name}_branch.png {base_image}", shell=True) - raise Exception("pictures has different sizes") from exp \ No newline at end of file + raise Exception("pictures has different sizes") from exp