docstr: Ensure rm_rf can remove directories with read-only files in them (#5524)
docstr_tok: ["Ensure","rm_rf","can","remove","directories","with","read-only","files","in","them","(","#","5524",")"]
code: def test_rm_rf_with_read_only_file(self, tmp_path):
      """Ensure rm_rf can remove directories with read-only files in them (#5524)"""
      fn = tmp_path / "dir/foo.txt"
      fn.parent.mkdir()
  
      fn.touch()
  
      self.chmod_r(fn)
  
      rm_rf(fn.parent)
  
      assert not fn.parent.is_dir()
  
imports: import dataclasses
  import os
  import stat
  import sys
  import warnings
  from pathlib import Path
  from typing import Callable
  from typing import cast
  from typing import List
  from typing import Union
  import pytest
  from _pytest import pathlib
  from _pytest.config import Config
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pathlib import cleanup_numbered_dir
  from _pytest.pathlib import create_cleanup_lock
  from _pytest.pathlib import make_numbered_dir
  from _pytest.pathlib import maybe_delete_a_numbered_dir
  from _pytest.pathlib import on_rm_rf_error
  from _pytest.pathlib import register_cleanup_lock_removal
  from _pytest.pathlib import rm_rf
  from _pytest.pytester import Pytester
  from _pytest.tmpdir import get_user
  from _pytest.tmpdir import TempPathFactory
label_desc: Use image node_id 2 for calling the TestRmRf obj's underlying member method code with example usage: obj.test_rm_rf_with_read_only_file(tmp_path) without return types