Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 13, 2024
1 parent ea31d69 commit c656536
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vizro-core/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 2 additions & 2 deletions vizro-core/tests/component_library/test_component_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
6 changes: 2 additions & 4 deletions vizro-core/tests/helpers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down Expand Up @@ -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
raise Exception("pictures has different sizes") from exp

0 comments on commit c656536

Please sign in to comment.