Bug 232213 - webkitpy tests warnings on Python 3.11
Summary: webkitpy tests warnings on Python 3.11
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 232214
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-24 04:49 PDT by Sam Sneddon [:gsnedders]
Modified: 2023-08-31 06:00 PDT (History)
3 users (show)

See Also:


Attachments
All warnings from Python 3.11.0 (18.43 KB, text/plain)
2022-11-24 03:44 PST, Sam Sneddon [:gsnedders]
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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).