Skip to content

Commit

Permalink
Enable reportUnsafeMultipleInheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Jul 12, 2024
1 parent db1d825 commit bfbdfb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ reportMissingTypeStubs = "information" # consider bumping to warning/error
reportUninitializedInstanceVariable = false # until https://github.com/DetachHead/basedpyright/issues/491
reportUnnecessaryTypeIgnoreComment = false # temporary
reportMissingParameterType = false # likely will be enabled (although ruff does cover this)
reportUnsafeMultipleInheritance = false # likely will be enabled
reportMissingSuperCall = false # likely will be enabled
reportIgnoreCommentWithoutRule = false # likely will be enabled (but only if enableTypeIgnoreComments remains disabled)

Expand Down
4 changes: 2 additions & 2 deletions tests/mcproto/protocol/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def assert_has_data(self, data: bytearray, ensure_called: bool = True) -> None:
raise AssertionError(f"Write function mock expected data {data!r}, but was {self.call_data!r}")


class WriteFunctionAsyncMock(WriteFunctionMock, AsyncMock):
class WriteFunctionAsyncMock(WriteFunctionMock, AsyncMock): # pyright: ignore[reportUnsafeMultipleInheritance]
"""Asynchronous mock write function, storing the written data."""


Expand Down Expand Up @@ -71,5 +71,5 @@ def assert_read_everything(self, ensure_called: bool = True) -> None:
)


class ReadFunctionAsyncMock(ReadFunctionMock, AsyncMock):
class ReadFunctionAsyncMock(ReadFunctionMock, AsyncMock): # pyright: ignore[reportUnsafeMultipleInheritance]
"""Asynchronous mock read function, giving pre-defined data."""
6 changes: 3 additions & 3 deletions tests/mcproto/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tests.mcproto.protocol.helpers import ReadFunctionAsyncMock, ReadFunctionMock, WriteFunctionMock


class MockSocket(CustomMockMixin[MagicMock], MagicMock):
class MockSocket(CustomMockMixin[MagicMock], MagicMock): # pyright: ignore[reportUnsafeMultipleInheritance]
"""Mock version of a socket (synchronous), using our mocked writer and reader methods.
See :class:`tests.mcproto.protocol.helpers.ReadFunctionMock` and
Expand Down Expand Up @@ -53,7 +53,7 @@ def shutdown(self, __how: int, /) -> None:
"""Mock version of shutdown, without any real implementation."""


class MockStreamWriter(CustomMockMixin[MagicMock], MagicMock):
class MockStreamWriter(CustomMockMixin[MagicMock], MagicMock): # pyright: ignore[reportUnsafeMultipleInheritance]]
"""Mock version of :class:`asyncio.StreamWriter` using our mocked writer method."""

spec_set = asyncio.StreamWriter
Expand All @@ -77,7 +77,7 @@ def close(self) -> None:
self._closed = True


class MockStreamReader(CustomMockMixin[MagicMock], MagicMock):
class MockStreamReader(CustomMockMixin[MagicMock], MagicMock): # pyright: ignore[reportUnsafeMultipleInheritance]]
"""Mock version of :class:`asyncio.StreamReader` using our mocked reader method."""

spec_set = asyncio.StreamReader
Expand Down

0 comments on commit bfbdfb6

Please sign in to comment.