Skip to content

Commit 506976d

Browse files
committed
testcase: Drop __enter__() return types
Most recent ruff complains about > PYI034 `__enter__` methods in classes like `SpawnedMock` usually return `self` at runtime > help: Use `Self` as return type But neither `Self` nor `self` nor `"Self"` actually works. Let's not bother, mypy figures out the return type just fine.
1 parent b701392 commit 506976d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dbusmock/testcase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __init__(self, bustype: BusType):
135135
"""
136136
)
137137

138-
def __enter__(self) -> "PrivateDBus":
138+
def __enter__(self):
139139
# Allow for start() to be called manually even before the `with`
140140
if self._daemon is None:
141141
self.start()
@@ -439,7 +439,7 @@ def obj(self):
439439
"""The D-Bus object this server was spawned for"""
440440
return self._obj
441441

442-
def __enter__(self) -> "SpawnedMock":
442+
def __enter__(self):
443443
return self
444444

445445
def __exit__(self, exc_type, exc_val, exc_tb):

0 commit comments

Comments
 (0)