fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
⌀
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
69
TestConfigTmpPath
def
class
test_getbasetemp_custom_removes_old
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
70
test_getbasetemp_custom_removes_old
def
function
def test_getbasetemp_custom_removes_old(self, pytester: Pytester) -> None: mytemp = pytester.path.joinpath("xyz") p = pytester.makepyfile( """ def test_1(tmp_path): pass """ ) pytester.runpytest(p, "--basetemp=%s" % mytemp) asse...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
72
makepyfile
ref
function
p = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
78
runpytest
ref
function
pytester.runpytest(p, "--basetemp=%s" % mytemp)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
82
runpytest
ref
function
pytester.runpytest(p, "--basetemp=%s" % mytemp)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
99
parametrize
ref
function
@pytest.mark.parametrize("basename, is_ok", testdata)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
100
test_mktemp
def
function
def test_mktemp(pytester: Pytester, basename: str, is_ok: bool) -> None: mytemp = pytester.mkdir("mytemp") p = pytester.makepyfile( """ def test_abs_path(tmp_path_factory): tmp_path_factory.mktemp('{}', numbered=_False) """.format( basename ) ) re...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
102
makepyfile
ref
function
p = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
111
runpytest
ref
function
result = pytester.runpytest(p, "--basetemp=%s" % mytemp)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
117
fnmatch_lines
ref
function
result.stdout.fnmatch_lines("*ValueError*")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
120
test_tmpdir_always_is_realpath
def
function
def test_tmpdir_always_is_realpath(pytester: Pytester) -> None: # the reason why tmpdir should be a realpath is that # when you cd to it and do "os.getcwd()" you will anyway # get the realpath. Using the symlinked path can thus # easily result in path-inequality # XXX if that proves to be a problem...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
129
attempt_symlink_to
ref
function
attempt_symlink_to(linktemp, str(realtemp))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
130
makepyfile
ref
function
p = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
137
runpytest
ref
function
result = pytester.runpytest("-s", p, "--basetemp=%s/bt" % linktemp)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
141
test_tmp_path_always_is_realpath
def
function
def test_tmp_path_always_is_realpath(pytester: Pytester, monkeypatch) -> None: # for reasoning see: test_tmpdir_always_is_realpath test-case realtemp = pytester.mkdir("myrealtemp") linktemp = pytester.path.joinpath("symlinktemp") attempt_symlink_to(linktemp, str(realtemp)) monkeypatch.setenv("PYTEST...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
145
attempt_symlink_to
ref
function
attempt_symlink_to(linktemp, str(realtemp))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
146
setenv
ref
function
monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(linktemp))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
147
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
153
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
154
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
157
test_tmp_path_too_long_on_parametrization
def
function
def test_tmp_path_too_long_on_parametrization(pytester: Pytester) -> None: pytester.makepyfile( """ import pytest @pytest.mark.parametrize("arg", ["1"*1000]) def test_some(arg, tmp_path): tmp_path.joinpath("hello").touch() """ ) reprec = pytester.inline_run() ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
158
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
166
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
167
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
170
test_tmp_path_factory
def
function
def test_tmp_path_factory(pytester: Pytester) -> None: pytester.makepyfile( """ import pytest @pytest.fixture(scope='session') def session_dir(tmp_path_factory): return tmp_path_factory.mktemp('data', numbered=_False) def test_some(session_dir): assert...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
171
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
181
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
182
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
185
test_tmp_path_fallback_tox_env
def
function
def test_tmp_path_fallback_tox_env(pytester: Pytester, monkeypatch) -> None: """Test that tmp_path works even if environment variables required by getpass module are missing (#1010). """ monkeypatch.delenv("USER", raising=_False) monkeypatch.delenv("USERNAME", raising=_False) pytester.makepyfile...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
189
delenv
ref
function
monkeypatch.delenv("USER", raising=False)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
190
delenv
ref
function
monkeypatch.delenv("USERNAME", raising=False)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
191
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
197
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
198
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
202
break_getuser
def
function
def break_getuser(monkeypatch): monkeypatch.setattr("os.getuid", lambda: -1) # taken from python 2.7/3.4 for envvar in ("LOGNAME", "USER", "LNAME", "USERNAME"): monkeypatch.delenv(envvar, raising=_False)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
206
delenv
ref
function
monkeypatch.delenv(envvar, raising=False)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
209
usefixtures
ref
function
@pytest.mark.usefixtures("break_getuser")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
210
skipif
ref
function
@pytest.mark.skipif(sys.platform.startswith("win"), reason="no os.getuid on windows")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
211
test_tmp_path_fallback_uid_not_found
def
function
def test_tmp_path_fallback_uid_not_found(pytester: Pytester) -> None: """Test that tmp_path works even if the current process's user id does not correspond to a valid user. """ pytester.makepyfile( """ def test_some(tmp_path): assert tmp_path.is_dir() """ ) repre...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
216
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
222
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
223
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
226
usefixtures
ref
function
@pytest.mark.usefixtures("break_getuser")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
227
skipif
ref
function
@pytest.mark.skipif(sys.platform.startswith("win"), reason="no os.getuid on windows")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
228
test_get_user_uid_not_found
def
function
def test_get_user_uid_not_found(): """Test that get_user() function works even if the current process's user id does not correspond to a valid user (e.g. running pytest in a Docker container with 'docker run -u'. """ assert get_user() is None
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
233
get_user
ref
function
assert get_user() is None
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
236
skipif
ref
function
@pytest.mark.skipif(not sys.platform.startswith("win"), reason="win only")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
237
test_get_user
def
function
def test_get_user(monkeypatch): """Test that get_user() function works even if environment variables required by getpass module are missing from the environment on Windows (#1010). """ monkeypatch.delenv("USER", raising=_False) monkeypatch.delenv("USERNAME", raising=_False) assert get_user()...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
242
delenv
ref
function
monkeypatch.delenv("USER", raising=False)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
243
delenv
ref
function
monkeypatch.delenv("USERNAME", raising=False)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
244
get_user
ref
function
assert get_user() is None
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
247
TestNumberedDir
def
class
test_make test_cleanup_lock_create test_lock_register_cleanup_removal _do_cleanup test_cleanup_keep test_cleanup_locked test_cleanup_ignores_symlink test_removal_accepts_lock
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
250
test_make
def
function
def test_make(self, tmp_path): for i in range(10): d = make_numbered_dir(root=tmp_path, prefix=self.PREFIX) assert d.name.startswith(self.PREFIX) assert d.name.endswith(str(i)) symlink = tmp_path.joinpath(self.PREFIX + "current") if symlink.exists(): ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
252
make_numbered_dir
ref
function
d = make_numbered_dir(root=tmp_path, prefix=self.PREFIX)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
262
test_cleanup_lock_create
def
function
def test_cleanup_lock_create(self, tmp_path): d = tmp_path.joinpath("test") d.mkdir() lockfile = create_cleanup_lock(d) with pytest.raises(OSError, match="cannot create lockfile in .*"): create_cleanup_lock(d) lockfile.unlink() def test_lock_register_cleanup...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
265
create_cleanup_lock
ref
function
lockfile = create_cleanup_lock(d)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
266
raises
ref
function
with pytest.raises(OSError, match="cannot create lockfile in .*"):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
267
create_cleanup_lock
ref
function
create_cleanup_lock(d)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
271
test_lock_register_cleanup_removal
def
function
def test_lock_register_cleanup_removal(self, tmp_path: Path) -> None: lock = create_cleanup_lock(tmp_path) registry: List[Callable[..., None]] = [] register_cleanup_lock_removal(lock, register=registry.append) (cleanup_func,) = registry assert lock.is_file() clean...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
272
create_cleanup_lock
ref
function
lock = create_cleanup_lock(tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
275
register_cleanup_lock_removal
ref
function
register_cleanup_lock_removal(lock, register=registry.append)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
281
cleanup_func
ref
function
cleanup_func(original_pid="intentionally_different")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
285
cleanup_func
ref
function
cleanup_func()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
289
cleanup_func
ref
function
cleanup_func()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
293
_do_cleanup
def
function
def _do_cleanup(self, tmp_path: Path) -> None: self.test_make(tmp_path) cleanup_numbered_dir( root=tmp_path, prefix=self.PREFIX, keep=2, consider_lock_dead_if_created_before=0, ) def test_cleanup_keep(self, tmp_path): self._do_clea...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
294
test_make
ref
function
self.test_make(tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
295
cleanup_numbered_dir
ref
function
cleanup_numbered_dir(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
302
test_cleanup_keep
def
function
def test_cleanup_keep(self, tmp_path): self._do_cleanup(tmp_path) a, b = (x for x in tmp_path.iterdir() if not x.is_symlink()) print(a, b) def test_cleanup_locked(self, tmp_path): p = make_numbered_dir(root=tmp_path, prefix=self.PREFIX) create_cleanup_lock(p) a...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
303
_do_cleanup
ref
function
self._do_cleanup(tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
307
test_cleanup_locked
def
function
def test_cleanup_locked(self, tmp_path): p = make_numbered_dir(root=tmp_path, prefix=self.PREFIX) create_cleanup_lock(p) assert not pathlib.ensure_deletable( p, consider_lock_dead_if_created_before=p.stat().st_mtime - 1 ) assert pathlib.ensure_deletable( ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
308
make_numbered_dir
ref
function
p = make_numbered_dir(root=tmp_path, prefix=self.PREFIX)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
310
create_cleanup_lock
ref
function
create_cleanup_lock(p)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
312
ensure_deletable
ref
function
assert not pathlib.ensure_deletable(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
315
ensure_deletable
ref
function
assert pathlib.ensure_deletable(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
319
test_cleanup_ignores_symlink
def
function
def test_cleanup_ignores_symlink(self, tmp_path): the_symlink = tmp_path / (self.PREFIX + "current") attempt_symlink_to(the_symlink, tmp_path / (self.PREFIX + "5")) self._do_cleanup(tmp_path) def test_removal_accepts_lock(self, tmp_path): folder = make_numbered_dir(root=tmp_path...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
321
attempt_symlink_to
ref
function
attempt_symlink_to(the_symlink, tmp_path / (self.PREFIX + "5"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
322
_do_cleanup
ref
function
self._do_cleanup(tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
324
test_removal_accepts_lock
def
function
def test_removal_accepts_lock(self, tmp_path): folder = make_numbered_dir(root=tmp_path, prefix=self.PREFIX) create_cleanup_lock(folder) maybe_delete_a_numbered_dir(folder) assert folder.is_dir()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
325
make_numbered_dir
ref
function
folder = make_numbered_dir(root=tmp_path, prefix=self.PREFIX)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
326
create_cleanup_lock
ref
function
create_cleanup_lock(folder)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
327
maybe_delete_a_numbered_dir
ref
function
maybe_delete_a_numbered_dir(folder)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
331
TestRmRf
def
class
test_rm_rf test_rm_rf_with_read_only_file chmod_r test_rm_rf_with_read_only_directory test_on_rm_rf_error
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
332
test_rm_rf
def
function
def test_rm_rf(self, tmp_path): adir = tmp_path / "adir" adir.mkdir() rm_rf(adir) assert not adir.exists() adir.mkdir() afile = adir / "afile" afile.write_bytes(b"aa") rm_rf(adir) assert not adir.exists() def test_rm_rf_with_read_only_f...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
335
rm_rf
ref
function
rm_rf(adir)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
343
rm_rf
ref
function
rm_rf(adir)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
346
test_rm_rf_with_read_only_file
def
function
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() ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
353
chmod_r
ref
function
self.chmod_r(fn)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
355
rm_rf
ref
function
rm_rf(fn.parent)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
359
chmod_r
def
function
def chmod_r(self, path): mode = os.stat(str(path)).st_mode os.chmod(str(path), mode & ~stat.S_IWRITE) def test_rm_rf_with_read_only_directory(self, tmp_path): """Ensure rm_rf can remove read-only directories (#5524)""" adir = tmp_path / "dir" adir.mkdir() (adir ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
363
test_rm_rf_with_read_only_directory
def
function
def test_rm_rf_with_read_only_directory(self, tmp_path): """Ensure rm_rf can remove read-only directories (#5524)""" adir = tmp_path / "dir" adir.mkdir() (adir / "foo.txt").touch() self.chmod_r(adir) rm_rf(adir) assert not adir.is_dir() def test_on_rm_...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
369
chmod_r
ref
function
self.chmod_r(adir)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
371
rm_rf
ref
function
rm_rf(adir)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
375
test_on_rm_rf_error
def
function
def test_on_rm_rf_error(self, tmp_path: Path) -> None: adir = tmp_path / "dir" adir.mkdir() fn = adir / "foo.txt" fn.touch() self.chmod_r(fn) # unknown exception with pytest.warns(pytest.PytestWarning): exc_info1 = (None, RuntimeError(), None) ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
381
chmod_r
ref
function
self.chmod_r(fn)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
384
warns
ref
function
with pytest.warns(pytest.PytestWarning):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
386
on_rm_rf_error
ref
function
on_rm_rf_error(os.unlink, str(fn), exc_info1, start_path=tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
391
on_rm_rf_error
ref
function
assert not on_rm_rf_error(None, str(fn), exc_info2, start_path=tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
394
warns
ref
function
with pytest.warns(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
399
on_rm_rf_error
ref
function
on_rm_rf_error(None, str(fn), exc_info3, start_path=tmp_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
405
warns
ref
function
with pytest.warns(None) as warninfo: # type: ignore[call-overload]