Skip to content

Commit

Permalink
Merge pull request #493 from micromoses/py310_fix_aio_warning_in_ut
Browse files Browse the repository at this point in the history
Py310 fix aio warning in ut
  • Loading branch information
boxed authored Feb 17, 2023
2 parents e7d48d6 + c7926bd commit 28d1a36
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion freezegun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 1 addition & 15 deletions tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 28d1a36

Please sign in to comment.