diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd425c894..870f73522 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.10 + rev: v0.11.0 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/test/test_environment.py b/test/test_environment.py index 4f8a3170f..6e7ed6fd8 100644 --- a/test/test_environment.py +++ b/test/test_environment.py @@ -89,7 +89,7 @@ def test_overridden_path(tmp_path, capfd): }, ) - assert len(os.listdir(output_dir)) == 0 + assert len(list(output_dir.iterdir())) == 0 captured = capfd.readouterr() assert "python available on PATH doesn't match our installed instance" in captured.err.replace( "venv", "installed" diff --git a/test/test_from_sdist.py b/test/test_from_sdist.py index 3bb7926db..b916271cc 100644 --- a/test/test_from_sdist.py +++ b/test/test_from_sdist.py @@ -53,7 +53,7 @@ def cibuildwheel_from_sdist_run( env=env, check=True, ) - return os.listdir(tmp_output_dir) + return [p.name for p in Path(tmp_output_dir).iterdir()] # tests diff --git a/test/test_testing.py b/test/test_testing.py index 4dfda9141..8bd810f50 100644 --- a/test/test_testing.py +++ b/test/test_testing.py @@ -1,5 +1,4 @@ import inspect -import os import subprocess import textwrap from pathlib import Path @@ -180,7 +179,7 @@ def test_failing_test(tmp_path): }, ) - assert len(os.listdir(output_dir)) == 0 + assert len(list(output_dir.iterdir())) == 0 @pytest.mark.parametrize("test_runner", ["pytest", "unittest"]) diff --git a/test/utils.py b/test/utils.py index 921494e26..4548f0a52 100644 --- a/test/utils.py +++ b/test/utils.py @@ -140,7 +140,7 @@ def cibuildwheel_run( cwd=project_path, check=True, ) - wheels = os.listdir(output_dir or tmp_output_dir) + wheels = [p.name for p in (output_dir or Path(tmp_output_dir)).iterdir()] return wheels