mirror of
https://github.com/python/cpython.git
synced 2025-10-12 01:43:12 +00:00
gh-109505: Remove unnecessary hasattr
checks from test_asyncio
(#109506)
This commit is contained in:
parent
b10de68c6c
commit
0d20fc7477
2 changed files with 3 additions and 7 deletions
|
@ -1,6 +1,5 @@
|
||||||
"""Tests for events.py."""
|
"""Tests for events.py."""
|
||||||
|
|
||||||
import collections.abc
|
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import functools
|
import functools
|
||||||
import io
|
import io
|
||||||
|
@ -2335,8 +2334,6 @@ class HandleTests(test_utils.TestCase):
|
||||||
h = loop.call_later(0, noop)
|
h = loop.call_later(0, noop)
|
||||||
check_source_traceback(h)
|
check_source_traceback(h)
|
||||||
|
|
||||||
@unittest.skipUnless(hasattr(collections.abc, 'Coroutine'),
|
|
||||||
'No collections.abc.Coroutine')
|
|
||||||
def test_coroutine_like_object_debug_formatting(self):
|
def test_coroutine_like_object_debug_formatting(self):
|
||||||
# Test that asyncio can format coroutines that are instances of
|
# Test that asyncio can format coroutines that are instances of
|
||||||
# collections.abc.Coroutine, but lack cr_core or gi_code attributes
|
# collections.abc.Coroutine, but lack cr_core or gi_code attributes
|
||||||
|
|
|
@ -37,10 +37,9 @@ from test.support import threading_helper
|
||||||
|
|
||||||
|
|
||||||
def data_file(*filename):
|
def data_file(*filename):
|
||||||
if hasattr(support, 'TEST_HOME_DIR'):
|
fullname = os.path.join(support.TEST_HOME_DIR, *filename)
|
||||||
fullname = os.path.join(support.TEST_HOME_DIR, *filename)
|
if os.path.isfile(fullname):
|
||||||
if os.path.isfile(fullname):
|
return fullname
|
||||||
return fullname
|
|
||||||
fullname = os.path.join(os.path.dirname(__file__), '..', *filename)
|
fullname = os.path.join(os.path.dirname(__file__), '..', *filename)
|
||||||
if os.path.isfile(fullname):
|
if os.path.isfile(fullname):
|
||||||
return fullname
|
return fullname
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue