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

Wrap partial in enum.member for Python 3.11+ #238

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: [3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions tests/async_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import warnings
import sys



Expand All @@ -11,6 +12,9 @@ def _await(coro):
ret = loop.run_until_complete(coro)
loop.close()

for warn in warns:
print(warn.message, file=sys.stderr)

if warns:
raise RuntimeError

Expand Down
15 changes: 12 additions & 3 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
import inspect
import pickle
import re
import sys
import unittest
try:
from unittest import mock
except ImportError:
import mock

if sys.version_info >= (3, 11):
from enum import member

import adb_shell.exceptions

try:
Expand Down Expand Up @@ -40,9 +44,14 @@ def __test_serialize_one_exc_cls(exc_cls):

for __obj in adb_shell.exceptions.__dict__.values():
if isinstance(__obj, type) and issubclass(__obj, BaseException):
__test_method = functools.partial(
__test_serialize_one_exc_cls, __obj
)
if sys.version_info >= (3, 11):
__test_method = member(functools.partial(
__test_serialize_one_exc_cls, __obj
))
else:
__test_method = functools.partial(
__test_serialize_one_exc_cls, __obj
)
__test_name = "test_serialize_{}".format(__obj.__name__)
locals()[__test_name] = __test_method

Expand Down
Loading