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

Py310 fix aio warning in ut #493

Merged
merged 8 commits into from
Feb 17, 2023
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
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