diff options
Diffstat (limited to 'tests/helpers/stubs.py')
-rw-r--r-- | tests/helpers/stubs.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index 997f160ce..0e4dd3b92 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -21,11 +21,12 @@ """Fake objects/stubs.""" +from typing import Any, Callable, Tuple from unittest import mock import contextlib import shutil +import dataclasses -import attr from PyQt5.QtCore import pyqtSignal, QPoint, QProcess, QObject, QUrl from PyQt5.QtGui import QIcon from PyQt5.QtNetwork import (QNetworkRequest, QAbstractNetworkCache, @@ -324,20 +325,20 @@ class FakeSignal: """ -@attr.s(frozen=True) +@dataclasses.dataclass(frozen=True) class FakeCommand: """A simple command stub which has a description.""" - name = attr.ib('') - desc = attr.ib('') - hide = attr.ib(False) - debug = attr.ib(False) - deprecated = attr.ib(False) - completion = attr.ib(None) - maxsplit = attr.ib(None) - takes_count = attr.ib(lambda: False) - modes = attr.ib((usertypes.KeyMode.normal, )) + name: str = '' + desc: str = '' + hide: bool = False + debug: bool = False + deprecated: bool = False + completion: Any = None + maxsplit: int = None + takes_count: Callable[[], bool] = lambda: False + modes: Tuple[usertypes.KeyMode] = (usertypes.KeyMode.normal, ) class FakeTimer(QObject): |