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-54781: Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/#94070

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
vstinner merged 8 commits intopython:mainfromvstinner:test_tkinter
Jun 22, 2022
Merged

gh-54781: Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/#94070

vstinner merged 8 commits intopython:mainfromvstinner:test_tkinter
Jun 22, 2022

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedJun 21, 2022
edited by bedevere-bot
Loading

Move Lib/tkinter/test/ to Lib/test/test_tkinter/.

Rename test_tk to test_tkinter, and rename test_ttk_guionly to test_ttk.

@vstinner
Copy link
MemberAuthor

I can still run tests on an newly installed (patched) Python 3.12:

$ /opt/py3.12/bin/python3.12 -m test test_tkinter -u all -v(...)Ran 731 tests in 6.853s$ /opt/py3.12/bin/python3.12 -m test test_ttk -u all -v(...)Ran 308 tests in 7.905s$ /opt/py3.12/bin/python3.12 -m test test_tkintertest_tkinter skipped -- Use of the 'gui' resource not enabledtest_tkinter skipped (resource denied)$ /opt/py3.12/bin/python3.12 -m test test_ttktest_ttk skipped -- Use of the 'gui' resource not enabledtest_ttk skipped (resource denied)

@vstinner
Copy link
MemberAuthor

Rename test_tk to test_tkinter

For me, it's disturbing when tests don't have the same name than the tested module. asyncio => test_asyncio. tkinter => test_tk ???

rename test_ttk_guionly to test_ttk

I can keep test_ttk_guionly name if you prefer, but for me, tests should use the GUI. Only the special tests test_ttk_textonly should have a special name, no?

@vstinner
Copy link
MemberAuthor

@vstinner
Copy link
MemberAuthor

This PR is special. I made the new directory tree "flat".support.py andtest_simpledialog.py now lives inLib/test/test_tkinter/. Previously,test_simpledialog.py was in atest_tkinter/ sub-directory.

Before:

Lib/tkinter/test/Lib/tkinter/test/READMELib/tkinter/test/__init__.pyLib/tkinter/test/support.pyLib/tkinter/test/test_tkinterLib/tkinter/test/test_tkinter/__init__.pyLib/tkinter/test/test_tkinter/test_colorchooser.pyLib/tkinter/test/test_tkinter/test_font.pyLib/tkinter/test/test_tkinter/test_geometry_managers.pyLib/tkinter/test/test_tkinter/test_images.pyLib/tkinter/test/test_tkinter/test_loadtk.pyLib/tkinter/test/test_tkinter/test_messagebox.pyLib/tkinter/test/test_tkinter/test_misc.pyLib/tkinter/test/test_tkinter/test_simpledialog.pyLib/tkinter/test/test_tkinter/test_text.pyLib/tkinter/test/test_tkinter/test_variables.pyLib/tkinter/test/test_tkinter/test_widgets.pyLib/tkinter/test/test_ttkLib/tkinter/test/test_ttk/__init__.pyLib/tkinter/test/test_ttk/test_extensions.pyLib/tkinter/test/test_ttk/test_style.pyLib/tkinter/test/test_ttk/test_widgets.pyLib/tkinter/test/widget_tests.py

After:

Lib/test/test_ttk/Lib/test/test_ttk/__init__.pyLib/test/test_ttk/test_extensions.pyLib/test/test_ttk/test_style.pyLib/test/test_ttk/test_widgets.pyLib/test/test_tkinter/Lib/test/test_tkinter/READMELib/test/test_tkinter/__init__.pyLib/test/test_tkinter/support.pyLib/test/test_tkinter/test_colorchooser.pyLib/test/test_tkinter/test_font.pyLib/test/test_tkinter/test_geometry_managers.pyLib/test/test_tkinter/test_images.pyLib/test/test_tkinter/test_loadtk.pyLib/test/test_tkinter/test_messagebox.pyLib/test/test_tkinter/test_misc.pyLib/test/test_tkinter/test_simpledialog.pyLib/test/test_tkinter/test_text.pyLib/test/test_tkinter/test_variables.pyLib/test/test_tkinter/test_widgets.pyLib/test/test_tkinter/widget_tests.py

@vstinner
Copy link
MemberAuthor

Windows (x64) job failed but I cannot get the logs. I cancelled the workflow. I still cannot see the logs. Strange.

@zware
Copy link
Member

Windows (x64) job failed but I cannot get the logs. I cancelled the workflow. I still cannot see the logs. Strange.

Thefailure is unrelated, see#94068.

@serhiy-storchakaserhiy-storchaka requested review fromserhiy-storchaka and removed request fora teamJune 21, 2022 15:54
@vstinner
Copy link
MemberAuthor

Oh. Windows build failed with an unrelated error:

Error: D:\a\cpython\cpython\Modules\socketmodule.c(7475,5): error C2065: 'HVSOCKET_CONTAINER_PASSTHRU': undeclared identifier [D:\a\cpython\cpython\PCbuild_socket.vcxproj]

@zooba
Copy link
Member

Yeah, seems we're in the middle of the rollout of new CI images, so there's a chance you'll get the older image and not see the error. But you'll need my PR for it to be reliable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Doespython -m test.test_tkinter still work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It would work if a__main__ module gets added. But it wastest.test_tk before, nottest.test_tkinter.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah you care about this command? If you do, I can add a__main__.py file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, please add it. And test different ways of running tests:

python -m test.test_xxxpython -m unittest test.test_xxxpython -m test test_xxx

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I added__main__ sub-modules. Example:

./python -m test.test_ttk -v./python -m test test_ttk -v -u all./python -m unittest test.test_ttk -v

The 3 commands end with:Ran 308 tests.

merwok reacted with thumbs up emoji

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why not use justloader.discover()?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I copy/paste the code from test_asyncio, it works, so I didn't change it :-)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Doesloader.discover() work with zipimport?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Does loader.discover() work with zipimport?

I have no idea. If there is an issue, I suggest to fix all load_tests() functions of Lib/test/ in a separated PR.

@serhiy-storchaka
Copy link
Member

Should it be backported?

@terryjreedy
Copy link
Member

I would prefer that ttk tests be included under test_tkinter, with names liketest_ttk_widgets, so thatpython -m test.test_tkinter (andpython -m test -ugui test_tkinter) tests everything. But re-organization details are up to Serhiy.

@terryjreedy
Copy link
Member

This patch will require changes to the scripts *nix distributions use to make tkinter (and IDLE) a separate install. I don't know how they would feel about backports.

@vstinner
Copy link
MemberAuthor

I rebased the PR to get the fix for the Windows build:#94068

@vstinner
Copy link
MemberAuthor

Should it be backported?

This specific PR change the name of two tests, so no, it should not be backported.

It also changes the build system (Linux, VS project). Honestly, it sounds risky and I would prefer to not backport it.

merwok reacted with thumbs up emoji

@vstinner
Copy link
MemberAuthor

I would prefer that ttk tests be included under test_tkinter

Oh. I tried to minimize changes in this PR. But I'm open to reorganizing tests.

@serhiy-storchaka: Are you fine with the 2 proposed tests, or do you want to merge them?

@vstinner
Copy link
MemberAuthor

vstinner commentedJun 21, 2022
edited
Loading

This patch will require changes to the scripts *nix distributions use to make tkinter (and IDLE) a separate install. I don't know how they would feel about backports.

Once issue#54781 will be fixed, I will properly document these changes in What's New in Python 3.12. IMO it fits into the Build Changes section.

@serhiy-storchaka
Copy link
Member

Are you fine with the 2 proposed tests, or do you want to merge them?

I was going to ask about merging them, but I am fine with the current state of this PR. If you are going to mergetest_ttk intotest_tkinter, do not forget abouttest_tcl.

Maybe do this in a separate PR?

@vstinner
Copy link
MemberAuthor

vstinner commentedJun 21, 2022
edited
Loading

I was going to ask about merging them, but I am fine with the current state of this PR. If you are going to merge test_ttk into test_tkinter, do not forget about test_tcl.

Oh, merging 3 Tkinter tests sound out of my skills. I don't know well this module and I would prefer if someone else do it.

Here I'm trying to focus on fixing the 12 years old issue#54781 :-) Perfect is the enemy of good ;-)

@vstinner
Copy link
MemberAuthor

@serhiy-storchaka: Does it look good to you like that?

@vstinner
Copy link
MemberAuthor

@serhiy-storchaka wrote "I am fine with the current state of this PR". I plan to merge the PR tomorrow if I don't hear back from@serhiy-storchaka.

* Add Lib/test/test_ttk/__init__.py based on test_ttk_guionly.py.* Remove Lib/test/test_ttk_guionly.py.
Remove Lib/test/test_tk.py.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@merwokmerwokmerwok left review comments

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@vstinner@zware@zooba@serhiy-storchaka@terryjreedy@merwok@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp