GeezerVison is showing github.com — gh-109295: Skip test_generated_cases if different mount drives by vstinner · Pull Request #109308 · python/cpython
Conversation
vstinner
commented
Sep 12, 2023
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
On Windows, skip the test if the current working directory and the Python source code directory have different mount drives. It happens if the temporary directory is on a different mount drive than the Python source code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
On Windows, skip the test if the current working directory and the
Python source code directory have different mount drives. It happens
if the temporary directory is on a different mount drive than the
Python source code.
|
Example without the fix:
vstinner@WIN C:\victor\python\main>cd
C:\victor\python\main
vstinner@WIN C:\victor\python\main>python -m test test_generated_cases --tempdir=E:\TEMP\ -j1
Running Debug|x64 interpreter...
0:00:00 Run tests in parallel using 1 child processes
0:00:00 [1/1/1] test_generated_cases failed (uncaught exception)
test test_generated_cases crashed -- Traceback (most recent call last):
(...)
File "C:\victor\python\main\Lib\test\test_generated_cases.py", line 11, in <module>
import generate_cases
File "C:\victor\python\main\Tools\cases_generator\generate_cases.py", line 41, in <module>
DEFAULT_INPUT = os.path.relpath(os.path.join(ROOT, "Python/bytecodes.c"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\victor\python\main\Lib\ntpath.py", line 791, in relpath
raise ValueError("path is on mount %r, start on mount %r" % (
ValueError: path is on mount 'C:', start on mount 'E:'
== Tests result: FAILURE ==
1 test failed:
test_generated_cases
Total duration: 793 ms
Total tests: run=0
Total test files: run=1/1 failed=1
Result: FAILURE
With the fix:
vstinner@WIN C:\victor\python\main>cd
C:\victor\python\main
vstinner@WIN C:\victor\python\main>python -m test test_generated_cases --tempdir=E:\TEMP\ -j1
Running Debug|x64 interpreter...
0:00:00 Run tests in parallel using 1 child processes
0:00:00 [1/1] test_generated_cases skipped
test_generated_cases skipped -- the current working directory and the Python source code directory have different mount drives (E: and C:)
== Tests result: SUCCESS ==
1 test skipped:
test_generated_cases
Total duration: 613 ms
Total tests: run=0
Total test files: run=1/1 skipped=1
Result: SUCCESS
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sorry, @vstinner, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 936376916100681d46db117bae0ec05adf338051 3.11
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sorry, @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 936376916100681d46db117bae0ec05adf338051 3.12
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Python 3.11 and 3.12 are not affected: Lib/test/test_generated_cases.py is new in Python 3.13.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
An alternative would be to change the current working directory while testing test_generated_cases, as done by test_pyexpat: #109233
But the problem is that the directory should be changed early when test_generated_cases.py is imported, before the first Tools/cases_generator/ import, and the old directory should be restore "later". But when is "later"? After the import? And then change again cwd while running tests using setUpModule()/tearDownModule()?
Well, for me it was too complicated, and I made the minimum fix: just skip the test.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
added a commit
to vstinner/cpython
that referenced
this pull request
Sep 13, 2023
…ython#109308)
On Windows, skip the test if the current working directory and the
Python source code directory have different mount drives. It happens
if the temporary directory is on a different mount drive than the
Python source code.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|