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

imp module DeprecationWarning in test suite #69673

Closed
vadmium opened this issue Oct 27, 2015 · 3 comments
Closed

imp module DeprecationWarning in test suite #69673

vadmium opened this issue Oct 27, 2015 · 3 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@vadmium
Copy link
Member

vadmium commented Oct 27, 2015

BPO 25487
Nosy @brettcannon, @vadmium

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/brettcannon'
closed_at = <Date 2015-10-30.21:41:41.209>
created_at = <Date 2015-10-27.00:38:47.848>
labels = ['type-bug', 'tests']
title = 'imp module DeprecationWarning in test suite'
updated_at = <Date 2015-10-30.21:41:41.208>
user = 'https://github.com/vadmium'

bugs.python.org fields:

activity = <Date 2015-10-30.21:41:41.208>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2015-10-30.21:41:41.209>
closer = 'brett.cannon'
components = ['Tests']
creation = <Date 2015-10-27.00:38:47.848>
creator = 'martin.panter'
dependencies = []
files = []
hgrepos = []
issue_num = 25487
keywords = []
message_count = 3.0
messages = ['253509', '253762', '253763']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'python-dev', 'martin.panter']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue25487'
versions = ['Python 3.6']

@vadmium
Copy link
Member Author

vadmium commented Oct 27, 2015

I typically run the test suite with the “python -bWall” options enabled, and there is a new warning. I suspect it is a result of the DeprecationWarning upgrade in revision 5877c191b76e. When -Werror is enabled it causes test failure.

The fix is probably pretty easy; there are probably other deprecated modules tested in the test suite to copy from. I think there is a test.support function that can suppress deprecation warnings while importing a particular module.

$ make -s -j2 && LC_TIME= ./python -bWall -m test.regrtest -j0
. . .
[167/399] test_imp
/media/disk/home/proj/python/cpython/Lib/test/test_imp.py:16: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
. . .
[207/399] test_modulefinder -- running: test_lzma (39 sec)
/media/disk/home/proj/python/cpython/Lib/modulefinder.py:14: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
. . .
[335/399] test_threaded_import -- running: test_tarfile (36 sec), test_subprocess (62 sec)
/media/disk/home/proj/python/cpython/Lib/modulefinder.py:14: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

@vadmium vadmium added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Oct 27, 2015
@brettcannon brettcannon self-assigned this Oct 27, 2015
@python-dev
Copy link
Mannequin

python-dev mannequin commented Oct 30, 2015

New changeset 3f924cb4c3eb by Brett Cannon in branch 'default':
Issue bpo-25487: Fix tests not updated when the imp module moved to a
https://hg.python.org/cpython/rev/3f924cb4c3eb

@brettcannon
Copy link
Member

Thanks for the finding these, Martin!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants