Skip to content
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

Remove script path in PlatformTests #4381

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

mwichmann
Copy link
Collaborator

@mwichmann mwichmann commented Jul 20, 2023

For Python 3.12+, cpython module posixpath test-importsposix, expecting it to fail on win32. However, for this one test program, since it's in SCons/Platform, that directory as the "script path" is in sys.path, and it finds our posix module, thus breaking things. This removes that element from the path - it's not put back because we don't actually need it here.

Fixes #4376

Unrelated - UtilTests.py is moved down into SCons/Util, to follow the usual naming conventions where the unit test is in the package dir.

This is a test-only change, no impacts on SCons itself.

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt (and read the README.rst)
  • I have updated the appropriate documentation

@mwichmann mwichmann added testsuite Things that only affect the SCons testing. Do not use just because a PR has tests. Python 3.12 labels Jul 20, 2023
For Python 3.12+, cpython module "posixpath" test-imports 'posix',
expecting it to fail on win32. However, for this one test program,
since it's in SCons/Platform, that directory as the "script path"
is in sys.path, and it finds our "posix" module, thus breaking things.
This removes that element from the path - it's not put back because
we don't actually need it here.

Fixes SCons#4376

Signed-off-by: Mats Wichmann <mats@linux.com>
@bdbaddog bdbaddog merged commit b3ce3e2 into SCons:master Jul 21, 2023
4 of 5 checks passed
@mwichmann mwichmann added this to the NextRelease milestone Jul 21, 2023
@mwichmann mwichmann deleted the test/posix-module branch July 21, 2023 18:41
mwichmann added a commit to mwichmann/scons that referenced this pull request Jul 27, 2023
Oops, missed that SCons/Platform/virtualenvTests.py needed the same
hack as SCons/Platform/PlatformTests.py (in PR SCons#4381)

Signed-off-by: Mats Wichmann <mats@linux.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python 3.12 testsuite Things that only affect the SCons testing. Do not use just because a PR has tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unittest import loop with pre-release Python
2 participants