Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-123780: Make test_pkgutil clean upspam module#123036

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 1 commit intopython:mainfrommhsmith:test-pkgutil-spam
Sep 6, 2024

Conversation

mhsmith
Copy link
Member

@mhsmithmhsmith commentedAug 15, 2024
edited by bedevere-appbot
Loading

When running the tests with --randomize, as is done by the buildbots, I came across this failure:

======================================================================ERROR: test_find_class (test.test_pickle.CUnpicklerTests.test_find_class)----------------------------------------------------------------------Traceback (most recent call last):  File "/Users/msmith/git/python/cpython/Lib/test/pickletester.py", line 1265, in test_find_class    self.assertRaises(ModuleNotFoundError, unpickler.find_class, 'spam', 'log')    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Users/msmith/git/python/cpython/Lib/unittest/case.py", line 804, in assertRaises    return context.handle('assertRaises', args, kwargs)           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Users/msmith/git/python/cpython/Lib/unittest/case.py", line 238, in handle    callable_obj(*args, **kwargs)    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^AttributeError: module 'spam' has no attribute 'log'======================================================================ERROR: test_find_class (test.test_pickle.PyUnpicklerTests.test_find_class)----------------------------------------------------------------------Traceback (most recent call last):  File "/Users/msmith/git/python/cpython/Lib/test/pickletester.py", line 1265, in test_find_class    self.assertRaises(ModuleNotFoundError, unpickler.find_class, 'spam', 'log')    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Users/msmith/git/python/cpython/Lib/unittest/case.py", line 804, in assertRaises    return context.handle('assertRaises', args, kwargs)           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Users/msmith/git/python/cpython/Lib/unittest/case.py", line 238, in handle    callable_obj(*args, **kwargs)    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^  File "/Users/msmith/git/python/cpython/Lib/pickle.py", line 1620, in find_class    return getattr(sys.modules[module], name)AttributeError: module 'spam' has no attribute 'log'----------------------------------------------------------------------Ran 857 tests in 2.954sFAILED (errors=2, skipped=31)test test_pickle failed

This can be reproduced by running only test_pkgutil and test_pickle, in that order. test_pkgutil leaves behind aspam module insys.modules, while test_pickle assumes there is no such module.

@encukou
Copy link
Member

PRs that need backporting should notskip issue; the issue number helps keep related PRs grouped together.

@encukouencukou changed the titleMake test_pkgutil clean upspam modulegh-123780: Make test_pkgutil clean upspam moduleSep 6, 2024
@encukouencukou merged commiteca3fe4 intopython:mainSep 6, 2024
41 checks passed
@miss-islington-app
Copy link

Thanks@mhsmith for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 6, 2024
…23036)(cherry picked from commiteca3fe4)Co-authored-by: Malcolm Smith <smith@chaquo.com>
@bedevere-app
Copy link

GH-123781 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 6, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 6, 2024
…23036)(cherry picked from commiteca3fe4)Co-authored-by: Malcolm Smith <smith@chaquo.com>
@bedevere-app
Copy link

GH-123782 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelSep 6, 2024
Yhg1s pushed a commit that referenced this pull requestSep 6, 2024
#123781)gh-123780: Make test_pkgutil clean up `spam` module (GH-123036)(cherry picked from commiteca3fe4)Co-authored-by: Malcolm Smith <smith@chaquo.com>
encukou pushed a commit that referenced this pull requestSep 9, 2024
GH-123782)(cherry picked from commiteca3fe4)Co-authored-by: Malcolm Smith <smith@chaquo.com>
@mhsmith
Copy link
MemberAuthor

PRs that need backporting should notskip issue; the issue number helps keep related PRs grouped together.

OK, I'll remember that. But doesn't the original PR provide enough grouping already? It links to the backports, and the backports link to it.

@encukou
Copy link
Member

Well, not as clearly as the issue's Linked PRs section :)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@encukouencukouencukou approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees
No one assigned
Labels
skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@mhsmith@encukou

[8]ページ先頭

©2009-2025 Movatter.jp