Skip to content

Commit

Permalink
Add custom assert for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonymilne committed Nov 23, 2023
1 parent 4de4131 commit 452657e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions vizro-core/tests/integration/test_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import vizro.models as vm

from tests_utils import component_to_dict
from asserts import assert_components_equal
from vizro import Vizro
from vizro.managers import model_manager

Expand Down Expand Up @@ -152,4 +152,4 @@ def label_cases(cases, label):
def test_navigation_build(dashboard_result, dashboard_expected):
result = dashboard_result.navigation.build()
expected = dashboard_expected.navigation.build()
assert component_to_dict(result) == component_to_dict(expected)
assert_components_equal(result, expected)
4 changes: 0 additions & 4 deletions vizro-core/tests/tests_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
# This is not actually required but helps PyCharm find the right function when using "Go to declaration".
# The strange structure here is necessary so that tests_utils can be imported in an intuitive way without adding the
# whole tests folder to the pythonpath. See https://stackoverflow.com/a/75635524.
from asserts import assert_components_equal
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import re

import dash_bootstrap_components as dbc
import plotly
import pytest
from dash import html
from pydantic import ValidationError

import vizro.models as vm
from tests_utils import assert_components_equal
from asserts import assert_components_equal

from vizro._constants import ACCORDION_DEFAULT_TITLE


Expand Down

0 comments on commit 452657e

Please sign in to comment.