Skip to content

test_tools.test_freeze broken on Mac framework build–probably should be skipped #113384

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

Closed
smontanaro opened this issue Dec 21, 2023 · 1 comment
Assignees
Labels
OS-mac tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@smontanaro
Copy link
Contributor

smontanaro commented Dec 21, 2023

Bug report

Bug description:

I've been messing around with the Mac framework build and encountered a failing test_tools.test_freeze. It runs Tools/freeze/freeze.py which has this buried in it:

    if sys.platform == "darwin" and sysconfig.get_config_var("PYTHONFRAMEWORK"):
        print(f"{sys.argv[0]} cannot be used with framework builds of Python", file=sys.stderr)

That seems like the wrong way to skip the test, but I suppose it's useful if run from the command line. Based on a comment @ned-deily made in another issue, that might be better expressed as:

    if sys.platform == "darwin" and sys._framework:
        print(f"{sys.argv[0]} cannot be used with framework builds of Python",
              file=sys.stderr)

That said, test_tools/test_freeze.py should perhaps skip the test on Darwin framework builds with something like this:

diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
index 671ec2961e..4d3f7e1a76 100644
--- a/Lib/test/test_tools/test_freeze.py
+++ b/Lib/test/test_tools/test_freeze.py
@@ -14,6 +14,8 @@
 
 @support.requires_zlib()
 @unittest.skipIf(sys.platform.startswith('win'), 'not supported on Windows')
[email protected](sys.platform == "darwin" and sys._framework,
+                 'not supported on Mac framework builds')
 @support.skip_if_buildbot('not all buildbots have enough space')
 # gh-103053: Skip test if Python is built with Profile Guided Optimization
 # (PGO), since the test is just too slow in this case.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@smontanaro smontanaro added the type-bug An unexpected behavior, bug, or error label Dec 21, 2023
@Eclips4 Eclips4 added tests Tests in the Lib/test dir OS-mac labels Dec 22, 2023
@ronaldoussoren ronaldoussoren self-assigned this Dec 22, 2023
@ronaldoussoren
Copy link
Contributor

That's my bad, I added the error message but forgot to update the test.

ronaldoussoren added a commit to ronaldoussoren/cpython that referenced this issue Dec 22, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 22, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 22, 2023
ronaldoussoren added a commit that referenced this issue Dec 22, 2023
…113390) (#113395)

gh-113384: Skip test_freeze for framework builds on macOS (GH-113390)
(cherry picked from commit bee627c)

Co-authored-by: Ronald Oussoren <[email protected]>
ronaldoussoren added a commit that referenced this issue Dec 22, 2023
…113390) (#113396)

gh-113384: Skip test_freeze for framework builds on macOS (GH-113390)
(cherry picked from commit bee627c)

Co-authored-by: Ronald Oussoren <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants