From fa502a0db7a124dc0efe8925b2d447e8410ba2eb Mon Sep 17 00:00:00 2001 From: shatakshiiii Date: Wed, 22 May 2024 13:15:22 +0530 Subject: [PATCH] Address ruff PTH101 exceptions --- pyproject.toml | 1 - tests/conftest.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 608184c381..f35f7484d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -307,7 +307,6 @@ ignore = [ 'PT019', # Fixture `_mocked_func` without value is injected as parameter, use `@pytest.mark.usefixtures` instead 'PT022', # [*] No teardown in fixture `cmd_in_tty`, use `return` instead of `yield` 'PTH100', # `os.path.abspath()` should be replaced by `Path.resolve()` - 'PTH101', # `os.chmod()` should be replaced by `Path.chmod()` 'PTH103', # `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` 'PTH107', # `os.remove()` should be replaced by `Path.unlink()` 'PTH109', # `os.getcwd()` should be replaced by `Path.cwd()` diff --git a/tests/conftest.py b/tests/conftest.py index 6281140693..5e9f41c9f9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -119,9 +119,9 @@ def locked_directory(tmpdir: str) -> Generator[str, None, None]: :param tmpdir: Fixture for temporary directory :yields: The temporary directory """ - os.chmod(tmpdir, 0o000) + Path(tmpdir).chmod(0o000) yield tmpdir - os.chmod(tmpdir, 0o777) + Path(tmpdir).chmod(0o777) @pytest.fixture(scope="session")