8000 gh-109295: Skip test_generated_cases if different mount drives by vstinner · Pull Request #109308 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109295: Skip test_generated_cases if different mount drives #109308

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

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
22 changes: 21 additions & 1 deletion Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
import contextlib
import os
import sys
import tempfile
import unittest
import os

from test import support
from test import test_tools


def skip_if_different_mount_drives():
if sys.platform != 'win32':
return
ROOT = os.path.dirname(os.path.dirname(__file__))
root_drive = os.path.splitroot(ROOT)[0]
cwd_drive = os.path.splitroot(os.getcwd())[0]
if root_drive != cwd_drive:
# generate_cases.py uses relpath() which raises ValueError if ROOT
# and the current working different have different mount drives
# (on Windows).
raise unittest.SkipTest(
f"the current working directory and the Python source code "
f"directory have different mount drives "
f"({cwd_drive} and {root_drive})"
)
skip_if_different_mount_drives()


test_tools.skip_if_missing('cases_generator')
with test_tools.imports_under_tool('cases_generator'):
import generate_cases
Expand Down
0