Skip to content

Commit

Permalink
pythongh-109505: Remove unnecessary hasattr checks from `test_async…
Browse files Browse the repository at this point in the history
…io` (python#109506)
  • Loading branch information
sobolevn authored Sep 23, 2023
1 parent b10de68 commit 0d20fc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for events.py."""

import collections.abc
import concurrent.futures
import functools
import io
Expand Down Expand Up @@ -2335,8 +2334,6 @@ def check_source_traceback(h):
h = loop.call_later(0, noop)
check_source_traceback(h)

@unittest.skipUnless(hasattr(collections.abc, 'Coroutine'),
'No collections.abc.Coroutine')
def test_coroutine_like_object_debug_formatting(self):
# Test that asyncio can format coroutines that are instances of
# collections.abc.Coroutine, but lack cr_core or gi_code attributes
Expand Down
7 changes: 3 additions & 4 deletions Lib/test/test_asyncio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@


def data_file(*filename):
if hasattr(support, 'TEST_HOME_DIR'):
fullname = os.path.join(support.TEST_HOME_DIR, *filename)
if os.path.isfile(fullname):
return fullname
fullname = os.path.join(support.TEST_HOME_DIR, *filename)
if os.path.isfile(fullname):
return fullname
fullname = os.path.join(os.path.dirname(__file__), '..', *filename)
if os.path.isfile(fullname):
return fullname
Expand Down

0 comments on commit 0d20fc7

Please sign in to comment.