Title: [3.14] gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set (GH-151952) by gpshead · Pull Request #152744 · python/cpython · GitHub
Open Graph Title: [3.14] gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set (GH-151952) by gpshead · Pull Request #152744 · python/cpython
X Title: [3.14] gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set (GH-151952) by gpshead · Pull Request #152744 · python/cpython
Description: Fix tests in test_compileall, test_import, test_importlib, test_py_compile, and test_inspect to neutralize PYTHONPYCACHEPREFIX (cherry picked from commit 564c58c) Co-authored-by: Jiucheng(Oliver) git.jiucheng@gmail.com Issue: gh-151626 Manual backport notes (3.14) miss-islington could not cleanly backport this to 3.14 due to a conflict in Lib/test/test_inspect/test_inspect.py. The 3.14 branch predates the python -m inspect --details CLI test refactor that exists on main/3.15 (it still has the simpler TestMain.test_details rather than TestModuleCLI with the test_details_option_with_*/test_get_cli_details_for_* suite). The fix was translated to 3.14's dialect: The _expected_cached() helper was added verbatim from the original PR, in TestMain. It was applied to the single TestMain.test_details, replacing the environment-dependent module.__spec__.cached check. The redundant self.assertIn(module.__cached__, output) line (same pyc path, and itself failing under PYTHONPYCACHEPREFIX) was dropped. None of the main-only test machinery was pulled in. The other four files and the NEWS entry cherry-picked cleanly (identical hunks to the original). Verified: test_inspect, test_compileall, test_import, test_importlib, and test_py_compile all pass both normally and with PYTHONPYCACHEPREFIX set; make patchcheck is clean.
Open Graph Description: Fix tests in test_compileall, test_import, test_importlib, test_py_compile, and test_inspect to neutralize PYTHONPYCACHEPREFIX (cherry picked from commit 564c58c) Co-authored-by: Jiucheng(Oliver) g...
X Description: Fix tests in test_compileall, test_import, test_importlib, test_py_compile, and test_inspect to neutralize PYTHONPYCACHEPREFIX (cherry picked from commit 564c58c) Co-authored-by: Jiucheng(Oliver) g...
Opengraph URL: https://github.com/python/cpython/pull/152744
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6e60b887-a89b-2747-f325-837498f61afa |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DC58:2818E8:118BB05:179487C:6A52A251 |
| html-safe-nonce | 06af1c717d0d0c9b079357615ef935ad37e6986225a0fd4834ddb9009d81240c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzU4OjI4MThFODoxMThCQjA1OjE3OTQ4N0M6NkE1MkEyNTEiLCJ2aXNpdG9yX2lkIjoiNTY3NDMwMjA3OTMyMzI1MTI4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5005e58a70da53b5d0802a812df9108a57185c87005feb06ae9a00e4b836151b |
| hovercard-subject-tag | pull_request:3968732116 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/152744/files |
| twitter:image | https://avatars.githubusercontent.com/u/68491?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/68491?s=400&v=4 |
| og:image:alt | Fix tests in test_compileall, test_import, test_importlib, test_py_compile, and test_inspect to neutralize PYTHONPYCACHEPREFIX (cherry picked from commit 564c58c) Co-authored-by: Jiucheng(Oliver) g... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width