Skip to content

Commit

Permalink
Coverage: ignore if TYPE_CHECKING globally
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Mar 7, 2024
1 parent 42f10e9 commit c495919
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ omit =

[report]
exclude_lines =
if __name__ == .__main__.:
if __name__ == .__main__.:
if TYPE_CHECKING:
2 changes: 1 addition & 1 deletion guidata/configtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

from guidata.utils.misc import decode_fs_string, get_module_path, get_system_lang

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from qtpy import QtCore as QC
from qtpy import QtGui as QG
from qtpy import QtWidgets as QW
Expand Down
2 changes: 1 addition & 1 deletion guidata/dataset/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import guidata.dataset.dataitems as gdi
import guidata.dataset.datatypes as gdt

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
import guidata.dataset.datatypes as gdt

# ==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion guidata/dataset/dataitems.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
from guidata.config import _
from guidata.dataset.datatypes import DataItem, DataSet, ItemProperty

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from numpy import ndarray

from guidata.dataset.io import (
Expand Down
11 changes: 5 additions & 6 deletions guidata/dataset/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

DEBUG_DESERIALIZE = False

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from qtpy.QtCore import QSize
from qtpy.QtWidgets import QDialog, QWidget

Expand Down Expand Up @@ -273,9 +273,9 @@ def __init__(
self._name: str | None = None
self._default = default
self._help = help
self._props: dict[
Any, Any
] = {} # a dict realm->dict containing realm-specific properties
self._props: dict[Any, Any] = (
{}
) # a dict realm->dict containing realm-specific properties
self.set_prop("display", col=0, colspan=None, row=None, label=label)
self.set_prop("data", check_value=check)

Expand Down Expand Up @@ -1377,8 +1377,7 @@ class ActivableDataSet(DataSet):

@property
@abstractmethod
def enable(self) -> DataItem:
...
def enable(self) -> DataItem: ...

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion guidata/dataset/qtitemwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

# XXX: consider providing an interface here...

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from guidata.dataset.qtwidgets import DataSetEditLayout


Expand Down
2 changes: 1 addition & 1 deletion guidata/qthelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
from guidata.env import execenv
from guidata.external import darkdetect

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from collections.abc import Callable


Expand Down
2 changes: 1 addition & 1 deletion guidata/widgets/objecteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
DataFrameEditor = FakeObject()


if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
import numpy as np
from qtpy import QtWidgets as QW

Expand Down

0 comments on commit c495919

Please sign in to comment.