Skip to content

avoid importing testing module #907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ show_missing = true
skip_covered = true
sort = "Name"
exclude_lines = [
"pragma: no cover",
# These are regex patterns
'pragma: no cover',
'\.\.\.',
"raise NotImplementedError",
'raise NotImplementedError',
'if TYPE_CHECKING[\s:]',
]
omit = [
"src/idom/__main__.py",
Expand Down
9 changes: 7 additions & 2 deletions src/idom/widgets.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from base64 import b64encode
from typing import Any, Callable, Iterable, Tuple, TypeVar, Union
from typing import TYPE_CHECKING, Any, Callable, Iterable, Tuple, TypeVar, Union

from typing_extensions import Protocol

Expand All @@ -10,7 +10,6 @@
from . import html
from ._warnings import warn
from .core.types import ComponentConstructor, VdomDict
from .testing.backend import _hotswap, _MountFunc


def image(
Expand Down Expand Up @@ -95,6 +94,10 @@ def __call__(self, value: str) -> _CastTo:
...


if TYPE_CHECKING:
from .testing.backend import _MountFunc


def hotswap(
update_on_change: bool = False,
) -> Tuple[_MountFunc, ComponentConstructor]: # pragma: no cover
Expand All @@ -103,4 +106,6 @@ def hotswap(
DeprecationWarning,
stacklevel=2,
)
from .testing.backend import _hotswap

return _hotswap(update_on_change)