Fix all tests are skipped on Windows (#14994)

Fix all tests are skipped on Windows
This commit is contained in:
Motov Yurii 2026-02-25 11:37:59 +01:00 committed by GitHub
parent daba0aa328
commit 1fa1065f9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

View File

@ -10,9 +10,17 @@ skip_on_windows = pytest.mark.skipif(
)
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
THIS_DIR = Path(__file__).parent.resolve()
def pytest_collection_modifyitems(config, items: list[pytest.Item]) -> None:
if sys.platform != "win32":
return
for item in items:
item.add_marker(skip_on_windows)
item_path = Path(item.fspath).resolve()
if item_path.is_relative_to(THIS_DIR):
item.add_marker(skip_on_windows)
@pytest.fixture(name="runner")