-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…H-28153) Deprecation warnings about the loop argument were incorrectly emitted in cases when the loop argument was used inside the asyncio library, not from user code.
- Loading branch information
1 parent
ce83e42
commit c967bd5
Showing
11 changed files
with
234 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,10 @@ | ||
import os | ||
from test import support | ||
import unittest | ||
|
||
# Skip tests if we don't have concurrent.futures. | ||
support.import_module('concurrent.futures') | ||
|
||
|
||
def load_tests(loader, _, pattern): | ||
def load_tests(*args): | ||
pkg_dir = os.path.dirname(__file__) | ||
suite = AsyncioTestSuite() | ||
return support.load_package_tests(pkg_dir, loader, suite, pattern) | ||
|
||
|
||
class AsyncioTestSuite(unittest.TestSuite): | ||
"""A custom test suite that also runs setup/teardown for the whole package. | ||
Normally unittest only runs setUpModule() and tearDownModule() within each | ||
test module part of the test suite. Copying those functions to each file | ||
would be tedious, let's run this once and for all. | ||
""" | ||
def run(self, result, debug=False): | ||
ignore = support.ignore_deprecations_from | ||
tokens = { | ||
ignore("asyncio.base_events", like=r".*loop argument.*"), | ||
ignore("asyncio.unix_events", like=r".*loop argument.*"), | ||
ignore("asyncio.futures", like=r".*loop argument.*"), | ||
ignore("asyncio.runners", like=r".*loop argument.*"), | ||
ignore("asyncio.subprocess", like=r".*loop argument.*"), | ||
ignore("asyncio.tasks", like=r".*loop argument.*"), | ||
ignore("test.test_asyncio.test_events", like=r".*loop argument.*"), | ||
ignore("test.test_asyncio.test_queues", like=r".*loop argument.*"), | ||
ignore("test.test_asyncio.test_tasks", like=r".*loop argument.*"), | ||
} | ||
try: | ||
super().run(result, debug=debug) | ||
finally: | ||
support.clear_ignored_deprecations(*tokens) | ||
return support.load_package_tests(pkg_dir, *args) |
Oops, something went wrong.