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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
206
inline_run
ref
function
reprec = pytester.inline_run()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
207
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
210
usefixtures
ref
function
@pytest.mark.usefixtures("break_getuser")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
211
skipif
ref
function
@pytest.mark.skipif(sys.platform.startswith("win"), reason="no os.getuid on windows")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
212
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
217
get_user
ref
function
assert get_user() is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
220
skipif
ref
function
@pytest.mark.skipif(not sys.platform.startswith("win"), reason="win only")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
221
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
226
delenv
ref
function
monkeypatch.delenv("USER", raising=False)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
227
delenv
ref
function
monkeypatch.delenv("USERNAME", raising=False)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
228
get_user
ref
function
assert get_user() is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
231
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
234
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
236
make_numbered_dir
ref
function
d = make_numbered_dir(root=tmp_path, prefix=self.PREFIX)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
246
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
249
create_cleanup_lock
ref
function
lockfile = create_cleanup_lock(d)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
250
raises
ref
function
with pytest.raises(OSError, match="cannot create lockfile in .*"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
251
create_cleanup_lock
ref
function
create_cleanup_lock(d)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
255
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
256
create_cleanup_lock
ref
function
lock = create_cleanup_lock(tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
259
register_cleanup_lock_removal
ref
function
register_cleanup_lock_removal(lock, register=registry.append)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
265
cleanup_func
ref
function
cleanup_func(original_pid="intentionally_different")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
269
cleanup_func
ref
function
cleanup_func()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
273
cleanup_func
ref
function
cleanup_func()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
277
_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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
278
test_make
ref
function
self.test_make(tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
279
cleanup_numbered_dir
ref
function
cleanup_numbered_dir(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
286
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
287
_do_cleanup
ref
function
self._do_cleanup(tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
291
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
292
make_numbered_dir
ref
function
p = make_numbered_dir(root=tmp_path, prefix=self.PREFIX)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
294
create_cleanup_lock
ref
function
create_cleanup_lock(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
296
ensure_deletable
ref
function
assert not pathlib.ensure_deletable(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
299
ensure_deletable
ref
function
assert pathlib.ensure_deletable(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
303
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
305
attempt_symlink_to
ref
function
attempt_symlink_to(the_symlink, tmp_path / (self.PREFIX + "5"))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
306
_do_cleanup
ref
function
self._do_cleanup(tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
308
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
309
make_numbered_dir
ref
function
folder = make_numbered_dir(root=tmp_path, prefix=self.PREFIX)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
310
create_cleanup_lock
ref
function
create_cleanup_lock(folder)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
311
maybe_delete_a_numbered_dir
ref
function
maybe_delete_a_numbered_dir(folder)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
315
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
316
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
319
rm_rf
ref
function
rm_rf(adir)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
327
rm_rf
ref
function
rm_rf(adir)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
330
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
337
chmod_r
ref
function
self.chmod_r(fn)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
339
rm_rf
ref
function
rm_rf(fn.parent)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
343
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
347
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
353
chmod_r
ref
function
self.chmod_r(adir)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
355
rm_rf
ref
function
rm_rf(adir)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
359
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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
365
chmod_r
ref
function
self.chmod_r(fn)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
368
warns
ref
function
with pytest.warns(pytest.PytestWarning):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
370
on_rm_rf_error
ref
function
on_rm_rf_error(os.unlink, str(fn), exc_info1, start_path=tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
375
on_rm_rf_error
ref
function
assert not on_rm_rf_error(None, str(fn), exc_info2, start_path=tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
378
warns
ref
function
with pytest.warns(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
383
on_rm_rf_error
ref
function
on_rm_rf_error(None, str(fn), exc_info3, start_path=tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
389
warns
ref
function
with pytest.warns(None) as warninfo: # type: ignore[call-overload]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
391
on_rm_rf_error
ref
function
on_rm_rf_error(os.open, str(fn), exc_info4, start_path=tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
396
on_rm_rf_error
ref
function
on_rm_rf_error(os.unlink, str(fn), exc_info5, start_path=tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
400
attempt_symlink_to
def
function
def attempt_symlink_to(path, to_path): """Try to make a symlink from "path" to "to_path", skipping in case this platform does not support it or we don't have sufficient privileges (common on Windows).""" try: Path(path).symlink_to(Path(to_path)) except OSError: pytest.skip("could not cre...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
406
skip
ref
function
pytest.skip("could not create symbolic link")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
409
test_basetemp_with_read_only_files
def
function
def test_basetemp_with_read_only_files(pytester: Pytester) -> None: """Integration test for #5524""" pytester.makepyfile( """ import os import stat def test(tmp_path): fn = tmp_path / 'foo.txt' fn.write_text('hello') mode = os.stat(str(fn)).st...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
411
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
423
runpytest
ref
function
result = pytester.runpytest("--basetemp=tmp")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
426
runpytest
ref
function
result = pytester.runpytest("--basetemp=tmp")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
430
test_tmp_path_factory_handles_invalid_dir_characters
def
function
def test_tmp_path_factory_handles_invalid_dir_characters( tmp_path_factory: TempPathFactory, monkeypatch: MonkeyPatch
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
437
getbasetemp
ref
function
p = tmp_path_factory.getbasetemp()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
441
skipif
ref
function
@pytest.mark.skipif(not hasattr(os, "getuid"), reason="checks unix permissions")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
442
test_tmp_path_factory_create_directory_with_safe_permissions
def
function
def test_tmp_path_factory_create_directory_with_safe_permissions( tmp_path: Path, monkeypatch: MonkeyPatch
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
447
setenv
ref
function
monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(tmp_path))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
448
TempPathFactory
ref
function
tmp_factory = TempPathFactory(None, lambda *args: None, _ispytest=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
449
getbasetemp
ref
function
basetemp = tmp_factory.getbasetemp()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
457
skipif
ref
function
@pytest.mark.skipif(not hasattr(os, "getuid"), reason="checks unix permissions")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
458
test_tmp_path_factory_fixes_up_world_readable_permissions
def
function
def test_tmp_path_factory_fixes_up_world_readable_permissions( tmp_path: Path, monkeypatch: MonkeyPatch
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
467
setenv
ref
function
monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(tmp_path))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
468
TempPathFactory
ref
function
tmp_factory = TempPathFactory(None, lambda *args: None, _ispytest=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
469
getbasetemp
ref
function
basetemp = tmp_factory.getbasetemp()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
475
TempPathFactory
ref
function
tmp_factory = TempPathFactory(None, lambda *args: None, _ispytest=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_tmpdir.py
testing/test_tmpdir.py
476
getbasetemp
ref
function
basetemp = tmp_factory.getbasetemp()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
10
test_simple_unittest
def
function
def test_simple_unittest(pytester: Pytester) -> None: testpath = pytester.makepyfile( """ import unittest class MyTestCase(unittest.TestCase): def testpassing(self): self.assertEqual('foo', 'foo') def test_failing(self): self.assertEqua...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
11
makepyfile
ref
function
testpath = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
21
inline_run
ref
function
reprec = pytester.inline_run(testpath)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
22
matchreport
ref
function
assert reprec.matchreport("testpassing").passed
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
23
matchreport
ref
function
assert reprec.matchreport("test_failing").failed
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
26
test_runTest_method
def
function
def test_runTest_method(pytester: Pytester) -> None: pytester.makepyfile( """ import unittest class MyTestCaseWithRunTest(unittest.TestCase): def runTest(self): self.assertEqual('foo', 'foo') class MyTestCaseWithoutRunTest(unittest.TestCase): d...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
27
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
40
runpytest
ref
function
result = pytester.runpytest("-v")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
41
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
50
test_isclasscheck_issue53
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
51
makepyfile
ref
function
testpath = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
60
runpytest
ref
function
result = pytester.runpytest(testpath)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
64
test_setup
def
function
def test_setup(pytester: Pytester) -> None: testpath = pytester.makepyfile( """ import unittest class MyTestCase(unittest.TestCase): def setUp(self): self.foo = 1 def setup_method(self, method): self.foo2 = 1 def test_both(s...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
65
makepyfile
ref
function
testpath = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
81
inline_run
ref
function
reprec = pytester.inline_run("-s", testpath)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
82
matchreport
ref
function
assert reprec.matchreport("test_both", when="call").passed
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
83
matchreport
ref
function
rep = reprec.matchreport("test_both", when="teardown")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_unittest.py
testing/test_unittest.py
87
test_setUpModule
def
function
def test_setUpModule(pytester: Pytester) -> None: testpath = pytester.makepyfile( """ values = [] def setUpModule(): values.append(1) def tearDownModule(): del values[0] def test_hello(): assert values == [1] def test_world(): ...