From 7d78866a79e73c1e23a2913fd0622f05ce9b3b0e Mon Sep 17 00:00:00 2001 From: shatakshiiii Date: Wed, 22 May 2024 13:24:50 +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 79dc2f0272..ba333f54ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -308,7 +308,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")