Bug 232213

Summary: webkitpy tests warnings on Python 3.11
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=260878
Bug Depends on: 232214    
Bug Blocks:    
Attachments:
Description Flags
All warnings from Python 3.11.0 none

Description Sam Sneddon [:gsnedders] 2021-10-24 04:49:45 PDT
Python 3.11 is removing a number of deprecated things, including various unittest methods: https://docs.python.org/3.11/whatsnew/3.11.html#removed / https://docs.python.org/3.10/library/unittest.html?highlight=unittest#deprecated-aliases

Our challenge here is the rename of assertRegexpMatches to assertRegex and assertRaisesRegexp to assertRaisesRegex (both deprecated since Python 3.2), plus assertNotRegexpMatches to assertNotRegex (deprecated since Python 3.5), since none of the new names exist in Python 2.7.
Comment 1 Alexey Proskuryakov 2021-10-24 17:12:36 PDT
I think that the only thing that needs Python 2.7 now is run-webkit-tests, which has mystery stability issues with Python 3. Everything else can and should be switched over at earliest opportunity.
Comment 2 Sam Sneddon [:gsnedders] 2021-10-25 03:39:59 PDT
(In reply to Alexey Proskuryakov from comment #1)
> I think that the only thing that needs Python 2.7 now is run-webkit-tests,
> which has mystery stability issues with Python 3. Everything else can and
> should be switched over at earliest opportunity.

webkit-patch still does, see bug 231591 (and there's at least another Apple-internal issue); I'm reluctant to break many tests on Python 2, especially when we're likely going to be able to drop it before Python 3.11 ships (in October 2022 or later). Partly filed this so we have some record that this needs done.

That said, one option is to rename the functions and mark the tests that use them as xfail on Python 2?
Comment 3 Radar WebKit Bug Importer 2021-10-25 03:40:10 PDT
<rdar://problem/84608525>
Comment 4 Sam Sneddon [:gsnedders] 2022-11-24 03:44:59 PST
Created attachment 463705 [details]
All warnings from Python 3.11.0

Many of these deprecations were pushed back to 3.12; see attached for all the warnings from running tests on 3.11.
Comment 5 Sam Sneddon [:gsnedders] 2023-08-31 06:00:29 PDT
(In reply to Sam Sneddon [:gsnedders] from comment #4)
> Created attachment 463705 [details]
> All warnings from Python 3.11.0
> 
> Many of these deprecations were pushed back to 3.12; see attached for all
> the warnings from running tests on 3.11.

Bug 260878 fixes many of these (or, rather, it fixes the subset where things are _removed_ in 3.12; other warnings survive).