diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aa260d2a..295efa9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,9 +30,16 @@ jobs: - '3.7' - '3.8' - '3.9' + - '3.10' + - '3.11' implementation: - '' # CPython - 'pypy' # PyPy + exclude: # unreleased; + - implementation: 'pypy' + python-version: '3.10' + - implementation: 'pypy' + python-version: '3.11' steps: - uses: actions/checkout@master diff --git a/freezegun/api.py b/freezegun/api.py index bcc83a6e..dfe4045c 100644 --- a/freezegun/api.py +++ b/freezegun/api.py @@ -619,7 +619,7 @@ def tearDown(*args, **kwargs): continue seen.add(attr) - if not callable(attr_value) or inspect.isclass(attr_value): + if not callable(attr_value) or inspect.isclass(attr_value) or isinstance(attr_value, staticmethod): continue try: diff --git a/setup.cfg b/setup.cfg index b18134f7..e93f3e9a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,8 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy diff --git a/tests/test_asyncio.py b/tests/test_asyncio.py index db2cdbe8..6f6a1a3a 100644 --- a/tests/test_asyncio.py +++ b/tests/test_asyncio.py @@ -14,18 +14,4 @@ def test_time_freeze_coroutine(): async def frozen_coroutine(): assert datetime.date.today() == datetime.date(1970, 1, 1) - asyncio.get_event_loop().run_until_complete(frozen_coroutine()) - - -def test_time_freeze_async_def(): - try: - exec('async def foo(): pass') - except SyntaxError: - raise SkipTest('async def not supported') - else: - exec(dedent(''' - @freeze_time('1970-01-01') - async def frozen_coroutine(): - assert datetime.date.today() == datetime.date(1970, 1, 1) - asyncio.get_event_loop().run_until_complete(frozen_coroutine()) - ''')) + asyncio.run(frozen_coroutine()) diff --git a/tox.ini b/tox.ini index c8f074a0..96a57033 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py37, py38, py39, pypy3, mypy +envlist = py37, py38, py39, py310, py311, pypy3, mypy [testenv] commands = pytest --cov {posargs}