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

gh-107262: update Tkinter tests for 8.6.14 #119322

Merged
merged 5 commits into from
May 30, 2024
Merged

Conversation

DBJim
Copy link
Contributor

@DBJim DBJim commented May 21, 2024

Update test assertions to pass with the changed behavior in Tk 8.6.14.

These two assertions are now only tested when the fixed Tk version is used, and it now tests for the correct result.

The tests are now passing locally on windows 64 bit when built with 8.6.14, which I hope should allow #116145 to progress for Windows.

Since it only changes the tests, I think news can be skipped.

@DBJim
Copy link
Contributor Author

DBJim commented May 21, 2024

@serhiy-storchaka could you please review?

@serhiy-storchaka serhiy-storchaka self-requested a review May 21, 2024 18:33
@DBJim
Copy link
Contributor Author

DBJim commented May 30, 2024

Hi @serhiy-storchaka, Would you mind taking a look? Let me know if you prefer to approach differently

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. I will look at this closer after I build Tcl/Tk 8.6.14.

I think that it is worth to keep tests for older Tk versions, which can still be in use. For example:

            self.checkParam(widget, 'padding', (5, 6, 7),
                            expected=(5, 6, 7) if patchlevel >= (8, 6, 14) else ('5', '6', '7'))

You should also run the tests after manually changing wantobjects = 1 to wantobjects = 0 in Lib/tkinter/__init__.py (unfortunately there is not option to do this without manual modification of the sources) and ensure that they are still passed.

So the final code could look rather like:

            self.checkParam(widget, 'padding', (5, 6, 7),
                            expected=('5', '6', '7') if self.wantobject or patchlevel < (8, 6, 14) else (5, 6, 7))

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

I updated tests, so they now pass with older Tcl/Tk.

@serhiy-storchaka
Copy link
Member

@DBJim, thank you for your contribution.

Maybe you're new to Git? I noticed that you made these changes in the main branch. This makes it difficult for you to generate other PRs. You should create a new branch from the main branch, commit all changes to that branch, and create a PR from that branch. This allows you to work on several PRs at the same time and preserves your main branch.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) May 30, 2024 18:44
@serhiy-storchaka serhiy-storchaka added skip news needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels May 30, 2024
@serhiy-storchaka serhiy-storchaka merged commit 9732ed5 into python:main May 30, 2024
36 checks passed
@miss-islington-app
Copy link

Thanks @DBJim for the PR, and @serhiy-storchaka 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 request May 30, 2024
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 30, 2024
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented May 30, 2024

GH-119806 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 30, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 30, 2024

GH-119807 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label May 30, 2024
serhiy-storchaka added a commit that referenced this pull request May 30, 2024
…H-119806)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request May 30, 2024
…H-119807)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants