Skip to content

Commit

Permalink
Remove tests of unsupported Python versions (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienVannson authored Nov 13, 2024
1 parent 1741a12 commit ed7eefa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
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

0 comments on commit ed7eefa

Please sign in to comment.