Skip to content
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

Remove tests of unsupported Python versions #642

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 2 additions & 10 deletions src/betterproto/enum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import sys
from enum import (
EnumMeta,
IntEnum,
Expand Down Expand Up @@ -90,15 +89,8 @@ def __call__(cls, value: int) -> Enum:
def __iter__(cls) -> Generator[Enum, None, None]:
yield from cls._member_map_.values()

if sys.version_info >= (3, 8): # 3.8 added __reversed__ to dict_values

def __reversed__(cls) -> Generator[Enum, None, None]:
yield from reversed(cls._member_map_.values())

else:

def __reversed__(cls) -> Generator[Enum, None, None]:
yield from reversed(tuple(cls._member_map_.values()))
def __reversed__(cls) -> Generator[Enum, None, None]:
yield from reversed(cls._member_map_.values())

def __getitem__(cls, key: str) -> Enum:
return cls._member_map_[key]
Expand Down
4 changes: 0 additions & 4 deletions tests/grpc/test_grpclib_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import sys
import uuid

import grpclib
Expand Down Expand Up @@ -91,9 +90,6 @@ async def test_trailer_only_error_stream_unary(


@pytest.mark.asyncio
@pytest.mark.skipif(
sys.version_info < (3, 8), reason="async mock spy does works for python3.8+"
)
async def test_service_call_mutable_defaults(mocker):
async with ChannelFor([ThingService()]) as channel:
client = ThingServiceClient(channel)
Expand Down
Loading