FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-124111: test macOS CI with Tk 9 by hugovk · Pull Request #137424 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .yml  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions .github/workflows/reusable-macos.yml
This file contains hidden or 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
Expand Up @@ -43,9 +43,9 @@ jobs:
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
- name: Install Homebrew dependencies
run: |
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8 make
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@9 make
# Because alternate versions are not symlinked into place by default:
brew link --overwrite tcl-tk@8
brew link --overwrite tcl-tk@9
- name: Configure CPython
run: |
MACOSX_DEPLOYMENT_TARGET=10.15 \
Expand Down
45 changes: 33 additions & 12 deletions Lib/test/test_tkinter/test_widgets.py
This file contains hidden or 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
Expand Up @@ -315,7 +315,10 @@ def test_configure_direction(self):

def test_configure_height(self):
widget = self.create()
self.checkIntegerParam(widget, 'height', 100, -100, 0, conv=str)
if tk_version < (9, 0):
self.checkIntegerParam(widget, 'height', 100, -100, 0, conv=str)
else:
self.checkIntegerParam(widget, 'height', 0, -100, 0)

def test_configure_image(self):
widget = self.create()
Expand All @@ -342,7 +345,10 @@ def test_configure_menu(self):

def test_configure_width(self):
widget = self.create()
self.checkIntegerParam(widget, 'width', 402, -402, 0, conv=str)
if tk_version < (9, 0):
self.checkIntegerParam(widget, 'width', 402, -402, 0, conv=str)
else:
self.checkIntegerParam(widget, 'width', 402, 0, 0)


class OptionMenuTest(MenubuttonTest, unittest.TestCase):
Expand Down Expand Up @@ -391,8 +397,12 @@ def test_configure_disabledbackground(self):

def test_configure_insertborderwidth(self):
widget = self.create(insertwidth=100)
self.checkPixelsParam(widget, 'insertborderwidth',
0, 1.3, 2.6, 6, '10p')
if tk_version < (9, 0):
self.checkPixelsParam(widget, 'insertborderwidth',
0, 1.3, 2.6, 6, '10p')
else:
self.checkPixelsParam(widget, 'insertborderwidth',
0, 1.3, 3, 6, '10p')
self.checkParam(widget, 'insertborderwidth', -2)
# insertborderwidth is bounded above by a half of insertwidth.
expected = 100 // 2 if tk_version < (9, 0) else 60
Expand Down Expand Up @@ -551,11 +561,22 @@ def test_configure_values(self):
# XXX
widget = self.create()
self.assertEqual(widget['values'], '')
self.checkParam(widget, 'values', 'mon tue wed thur')
if tk_version < (9, 0):
expected = 'mon tue wed thur'
else:
expected = ('mon', 'tue', 'wed', 'thur')
self.checkParam(widget, 'values', 'mon tue wed thur',
expected=expected)
self.checkParam(widget, 'values', ('mon', 'tue', 'wed', 'thur'),
expected='mon tue wed thur')
expected=expected)

if tk_version < (9, 0):
expected = '42 3.14 {} {any string}'
else:
expected = (42, 3.14, '', 'any string')
self.checkParam(widget, 'values', (42, 3.14, '', 'any string'),
expected='42 3.14 {} {any string}')
expected=expected)

self.checkParam(widget, 'values', '')

def test_configure_wrap(self):
Expand Down Expand Up @@ -649,10 +670,9 @@ def test_configure_endline(self):
def test_configure_height(self):
widget = self.create()
self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, '3c')
self.checkParam(widget, 'height', -100,
expected=1 if tk_version < (9, 0) else -100)
self.checkParam(widget, 'height', 0,
expected=1 if tk_version < (9, 0) else 0 )
expected = 1 if tk_version < (9, 0) else 0
self.checkParam(widget, 'height', -100, expected=expected)
self.checkParam(widget, 'height', 0, expected=expected)

def test_configure_maxundo(self):
widget = self.create()
Expand All @@ -670,8 +690,9 @@ def test_configure_insertunfocussed(self):

def test_configure_selectborderwidth(self):
widget = self.create()
value = -2 if tk_version < (9, 0) else 0
self.checkPixelsParam(widget, 'selectborderwidth',
1.3, 2.6, -2, '10p', conv=False)
1.3, 2.6, value, '10p', conv=False)

def test_configure_spacing1(self):
widget = self.create()
Expand Down
59 changes: 47 additions & 12 deletions Lib/test/test_tkinter/widget_tests.py
This file contains hidden or 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
Expand Up @@ -247,7 +247,11 @@ def test_configure_borderwidth(self):
widget = self.create()
self.checkPixelsParam(widget, 'borderwidth',
0, 1.3, 2.6, 6, '10p')
self.checkParam(widget, 'borderwidth', -2)
if tk_version < (9, 0):
self.checkParam(widget, 'borderwidth', -2)
else:
self.checkParam(widget, 'borderwidth', 0)

if 'bd' in self.OPTIONS:
self.checkPixelsParam(widget, 'bd', 0, 1.3, 2.6, 6, '10p')
self.checkParam(widget, 'bd', -2, expected=expected)
Expand All @@ -260,27 +264,46 @@ def test_configure_highlightthickness(self):

def test_configure_insertborderwidth(self):
widget = self.create()
self.checkPixelsParam(widget, 'insertborderwidth',
0, 1.3, 2.6, 6, '10p')
self.checkParam(widget, 'insertborderwidth', -2)
if tk_version < (9, 0):
values = (0, 1.3, 2.6, 6, -2, '10p')
value = -2
else:
values = (0, 1, 3, 6, 13)
value = 0
self.checkPixelsParam(widget, 'insertborderwidth', *values)
self.checkParam(widget, 'insertborderwidth', value)

def test_configure_insertwidth(self):
widget = self.create()
self.checkPixelsParam(widget, 'insertwidth', 1.3, 2.6, -2, '10p')
if tk_version < (9, 0):
self.checkPixelsParam(widget, 'insertwidth', 1.3, 2.6, -2, '10p')
else:
self.checkPixelsParam(widget, 'insertwidth', 1, 3, 0, 13)

def test_configure_padx(self):
widget = self.create()
self.checkPixelsParam(widget, 'padx', 3, 4.4, 5.6, '12m')
self.checkParam(widget, 'padx', -2)
if tk_version < (9, 0):
self.checkParam(widget, 'padx', -2)
else:
self.checkParam(widget, 'padx', 0)

def test_configure_pady(self):
widget = self.create()
self.checkPixelsParam(widget, 'pady', 3, 4.4, 5.6, '12m')
self.checkParam(widget, 'pady', -2)
if tk_version < (9, 0):
self.checkParam(widget, 'pady', -2)
else:
self.checkParam(widget, 'pady', 0)

def test_configure_selectborderwidth(self):
widget = self.create()
self.checkPixelsParam(widget, 'selectborderwidth', 1.3, 2.6, -2, '10p')
if tk_version < (9, 0):
values = (1.3, 2.6, -2, '10p')
else:
values = (1, 3, 0, 13)
self.checkPixelsParam(widget, 'selectborderwidth', *values)


class StandardOptionsTests(PixelOptionsTests):

Expand Down Expand Up @@ -546,22 +569,34 @@ class IntegerSizeTests:
""" Tests widgets which only accept integral width and height."""
def test_configure_height(self):
widget = self.create()
self.checkIntegerParam(widget, 'height', 100, -100, 0)
if tk_version < (9, 0):
self.checkIntegerParam(widget, 'height', 100, -100, 0)
else:
self.checkIntegerParam(widget, 'height', 100, 0, 0)

def test_configure_width(self):
widget = self.create()
self.checkIntegerParam(widget, 'width', 402, -402, 0)
if tk_version < (9, 0):
self.checkIntegerParam(widget, 'width', 402, -402, 0)
else:
self.checkIntegerParam(widget, 'width', 402, 0, 0)


class PixelSizeTests:
""" Tests widgets which accept screen distances for width and height."""
def test_configure_height(self):
widget = self.create()
self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, -100, 0, '3c')
value = -100 if tk_version < (9, 0) else 0
self.checkPixelsParam(
widget, 'height', 100, 101.2, 102.6, value, 0, '3c'
)

def test_configure_width(self):
widget = self.create()
self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i')
value = -402 if tk_version < (9, 0) else 0
self.checkPixelsParam(
widget, 'width', 402, 403.4, 404.6, value, 0, '5i'
)


def add_configure_tests(*source_classes):
Expand Down
Loading

Back | FazBrowse Home | New Git URL