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_collection.py | testing/test_collection.py | 1,119 | test_collect_with_chdir_during_import | def | function | def test_collect_with_chdir_during_import(pytester: Pytester) -> None:
subdir = pytester.mkdir("sub")
pytester.path.joinpath("conftest.py").write_text(
textwrap.dedent(
"""
import os
os.chdir(%r)
"""
% (str(subdir),)
)
)
pyteste... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,130 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,139 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,140 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*1 passed in*"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,144 | makeini | ref | function | pytester.makeini(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,151 | runpytest | ref | function | result = pytester.runpytest("--collect-only")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,152 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["collected 1 item"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,155 | test_collect_pyargs_with_testpaths | def | function | def test_collect_pyargs_with_testpaths(
pytester: Pytester, monkeypatch: MonkeyPatch
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,173 | setenv | ref | function | monkeypatch.setenv("PYTHONPATH", str(pytester.path), prepend=os.pathsep)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,175 | runpytest_subprocess | ref | function | result = pytester.runpytest_subprocess()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,176 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*1 passed in*"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,179 | test_collect_symlink_file_arg | def | function | def test_collect_symlink_file_arg(pytester: Pytester) -> None:
"""Collect a direct symlink works even if it does not match python_files (#4325)."""
real = pytester.makepyfile(
real="""
def test_nodeid(request):
assert request.node.nodeid == "symlink.py::test_nodeid"
"""
)... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,181 | makepyfile | ref | function | real = pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,188 | symlink_or_skip | ref | function | symlink_or_skip(real, symlink)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,189 | runpytest | ref | function | result = pytester.runpytest("-v", symlink)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,190 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["symlink.py::test_nodeid PASSED*", "*1 passed in*"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,194 | test_collect_symlink_out_of_tree | def | function | def test_collect_symlink_out_of_tree(pytester: Pytester) -> None:
"""Test collection of symlink via out-of-tree rootdir."""
sub = pytester.mkdir("sub")
real = sub.joinpath("test_real.py")
real.write_text(
textwrap.dedent(
"""
def test_nodeid(request):
# Should not... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,210 | symlink_or_skip | ref | function | symlink_or_skip(sub, symlink_to_sub)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,212 | runpytest | ref | function | result = pytester.runpytest("-vs", "--rootdir=%s" % sub, symlink_to_sub)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,213 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,222 | test_collect_symlink_dir | def | function | def test_collect_symlink_dir(pytester: Pytester) -> None:
"""A symlinked directory is collected."""
dir = pytester.mkdir("dir")
dir.joinpath("test_it.py").write_text("def test_it(): pass", "utf-8")
symlink_or_skip(pytester.path.joinpath("symlink_dir"), dir)
result = pytester.runpytest()
result.a... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,226 | symlink_or_skip | ref | function | symlink_or_skip(pytester.path.joinpath("symlink_dir"), dir)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,227 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,228 | assert_outcomes | ref | function | result.assert_outcomes(passed=2)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,231 | test_collectignore_via_conftest | def | function | def test_collectignore_via_conftest(pytester: Pytester) -> None:
"""collect_ignore in parent conftest skips importing child (issue #4592)."""
tests = pytester.mkpydir("tests")
tests.joinpath("conftest.py").write_text("collect_ignore = ['ignore_me']")
ignore_me = tests.joinpath("ignore_me")
ignore_m... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,233 | mkpydir | ref | function | tests = pytester.mkpydir("tests")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,241 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,245 | test_collect_pkg_init_and_file_in_args | def | function | def test_collect_pkg_init_and_file_in_args(pytester: Pytester) -> None:
subdir = pytester.mkdir("sub")
init = subdir.joinpath("__init__.py")
init.write_text("def test_init(): pass")
p = subdir.joinpath("test_file.py")
p.write_text("def test_file(): pass")
# NOTE: without "-o python_files=*.py" ... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,255 | runpytest | ref | function | result = pytester.runpytest("-v", str(init), str(p))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,256 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,264 | runpytest | ref | function | result = pytester.runpytest("-v", "-o", "python_files=*.py", str(init), str(p))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,265 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,274 | test_collect_pkg_init_only | def | function | def test_collect_pkg_init_only(pytester: Pytester) -> None:
subdir = pytester.mkdir("sub")
init = subdir.joinpath("__init__.py")
init.write_text("def test_init(): pass")
result = pytester.runpytest(str(init))
result.stdout.fnmatch_lines(["*no tests ran in*"])
result = pytester.runpytest("-v", ... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,279 | runpytest | ref | function | result = pytester.runpytest(str(init))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,280 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*no tests ran in*"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,282 | runpytest | ref | function | result = pytester.runpytest("-v", "-o", "python_files=*.py", str(init))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,283 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["sub/__init__.py::test_init PASSED*", "*1 passed in*"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,286 | parametrize | ref | function | @pytest.mark.parametrize("use_pkg", (True, False))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,287 | test_collect_sub_with_symlinks | def | function | def test_collect_sub_with_symlinks(use_pkg: bool, pytester: Pytester) -> None:
"""Collection works with symlinked files and broken symlinks"""
sub = pytester.mkdir("sub")
if use_pkg:
sub.joinpath("__init__.py").touch()
sub.joinpath("test_file.py").write_text("def test_file(): pass")
# Creat... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,295 | symlink_or_skip | ref | function | symlink_or_skip("test_doesnotexist.py", sub.joinpath("test_broken.py"))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,298 | symlink_or_skip | ref | function | symlink_or_skip("test_file.py", sub.joinpath("test_symlink.py"))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,300 | runpytest | ref | function | result = pytester.runpytest("-v", str(sub))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,301 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,310 | test_collector_respects_tbstyle | def | function | def test_collector_respects_tbstyle(pytester: Pytester) -> None:
p1 = pytester.makepyfile("assert 0")
result = pytester.runpytest(p1, "--tb=native")
assert result.ret == ExitCode.INTERRUPTED
result.stdout.fnmatch_lines(
[
"*_ ERROR collecting test_collector_respects_tbstyle.py _*",
... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,311 | makepyfile | ref | function | p1 = pytester.makepyfile("assert 0")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,312 | runpytest | ref | function | result = pytester.runpytest(p1, "--tb=native")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,314 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,327 | test_does_not_eagerly_collect_packages | def | function | def test_does_not_eagerly_collect_packages(pytester: Pytester) -> None:
pytester.makepyfile("def test(): pass")
pydir = pytester.mkpydir("foopkg")
pydir.joinpath("__init__.py").write_text("assert _False")
result = pytester.runpytest()
assert result.ret == ExitCode.OK
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,328 | makepyfile | ref | function | pytester.makepyfile("def test(): pass")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,329 | mkpydir | ref | function | pydir = pytester.mkpydir("foopkg")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,331 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,335 | test_does_not_put_src_on_path | def | function | def test_does_not_put_src_on_path(pytester: Pytester) -> None:
# `src` is not on sys.path so it should not be importable
ensure_file(pytester.path / "src/nope/__init__.py")
pytester.makepyfile(
"import pytest\n"
"def test():\n"
" with pytest.raises(ImportError):\n"
" ... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,337 | ensure_file | ref | function | ensure_file(pytester.path / "src/nope/__init__.py")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,338 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,344 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,348 | test_fscollector_from_parent | def | function | def test_fscollector_from_parent(pytester: Pytester, request: FixtureRequest) -> None:
"""Ensure File.from_parent can forward custom arguments to the constructor.
Context: https://github.com/pytest-dev/pytest-cpp/pull/47
"""
class MyCollector(pytest.File):
def __init__(self, *k, x, **kw):
... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,354 | MyCollector | def | class | __init__ __init__ from_parent |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,359 | from_parent | ref | function | collector = MyCollector.from_parent(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,365 | test_class_from_parent | def | class | |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,368 | MyCollector | def | class | __init__ __init__ from_parent |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,374 | from_parent | def | function | def from_parent(cls, parent, *, name, x):
return super().from_parent(parent=parent, name=name, x=x)
collector = MyCollector.from_parent(parent=request.session, name="foo", x=10)
assert collector.x == 10
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,375 | from_parent | ref | function | return super().from_parent(parent=parent, name=name, x=x)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,377 | from_parent | ref | function | collector = MyCollector.from_parent(parent=request.session, name="foo", x=10)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,381 | TestImportModeImportlib | def | class | test_collect_duplicate_names test_conftest setup_conftest_and_foo test_modules_importable_as_side_effect test_modules_not_importable_as_side_effect |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,382 | test_collect_duplicate_names | def | function | def test_collect_duplicate_names(self, pytester: Pytester) -> None:
"""--import-mode=importlib can import modules with same names that are not in packages."""
pytester.makepyfile(
**{
"tests_a/test_foo.py": "def test_foo1(): pass",
"tests_b/test_foo.py": "... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,384 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,390 | runpytest | ref | function | result = pytester.runpytest("-v", "--import-mode=importlib")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,391 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,399 | test_conftest | def | function | def test_conftest(self, pytester: Pytester) -> None:
"""Directory containing conftest modules are not put in sys.path as a side-effect of
importing them."""
tests_dir = pytester.path.joinpath("tests")
pytester.makepyfile(
**{
"tests/conftest.py": "",
... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,403 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,415 | runpytest | ref | function | result = pytester.runpytest("-v", "--import-mode=importlib")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,416 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["* 1 passed in *"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,418 | setup_conftest_and_foo | def | function | def setup_conftest_and_foo(self, pytester: Pytester) -> None:
"""Setup a tests folder to be used to test if modules in that folder can be imported
due to side-effects of --import-mode or not."""
pytester.makepyfile(
**{
"tests/conftest.py": "",
"te... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,421 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,435 | test_modules_importable_as_side_effect | def | function | def test_modules_importable_as_side_effect(self, pytester: Pytester) -> None:
"""In import-modes `prepend` and `append`, we are able to import modules from folders
containing conftest.py files due to the side effect of changing sys.path."""
self.setup_conftest_and_foo(pytester)
resul... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,438 | setup_conftest_and_foo | ref | function | self.setup_conftest_and_foo(pytester)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,439 | runpytest | ref | function | result = pytester.runpytest("-v", "--import-mode=prepend")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,440 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["* 1 passed in *"])
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,442 | test_modules_not_importable_as_side_effect | def | function | def test_modules_not_importable_as_side_effect(self, pytester: Pytester) -> None:
"""In import-mode `importlib`, modules in folders containing conftest.py are not
importable, as don't change sys.path or sys.modules as side effect of importing
the conftest.py file.
"""
self.se... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,447 | setup_conftest_and_foo | ref | function | self.setup_conftest_and_foo(pytester)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,448 | runpytest | ref | function | result = pytester.runpytest("-v", "--import-mode=importlib")
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,449 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,458 | test_does_not_crash_on_error_from_decorated_function | def | function | def test_does_not_crash_on_error_from_decorated_function(pytester: Pytester) -> None:
"""Regression test for an issue around bad exception formatting due to
assertion rewriting mangling lineno's (#4984)."""
pytester.makepyfile(
"""
@pytest.fixture
def a(): return 4
"""
)
... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,461 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,467 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,472 | test_does_not_crash_on_recursive_symlink | def | function | def test_does_not_crash_on_recursive_symlink(pytester: Pytester) -> None:
"""Regression test for an issue around recursive symlinks (#7951)."""
symlink_or_skip("recursive", pytester.path.joinpath("recursive"))
pytester.makepyfile(
"""
def test_foo(): assert _True
"""
)
result... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,474 | symlink_or_skip | ref | function | symlink_or_skip("recursive", pytester.path.joinpath("recursive"))
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,475 | makepyfile | ref | function | pytester.makepyfile(
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,480 | runpytest | ref | function | result = pytester.runpytest()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_collection.py | testing/test_collection.py | 1,483 | parseoutcomes | ref | function | assert result.parseoutcomes() == {"passed": 1}
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 21 | test_is_generator | def | function | def test_is_generator() -> None:
def zap():
yield # pragma: no cover
def foo():
pass # pragma: no cover
assert is_generator(zap)
assert not is_generator(foo)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 22 | zap | def | function | def zap():
yield # pragma: no cover
def foo():
pass # pragma: no cover
assert is_generator(zap)
assert not is_generator(foo)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 25 | foo | def | function | def foo():
pass # pragma: no cover
assert is_generator(zap)
assert not is_generator(foo)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 28 | is_generator | ref | function | assert is_generator(zap)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 29 | is_generator | ref | function | assert not is_generator(foo)
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 32 | test_real_func_loop_limit | def | function | def test_real_func_loop_limit() -> None:
class Evil:
def __init__(self):
self.left = 1000
def __repr__(self):
return f"<Evil left={self.left}>"
def __getattr__(self, attr):
if not self.left:
raise RuntimeError("it's over") # pragma: no c... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 33 | Evil | def | class | __init__ __repr__ __getattr__ |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 40 | __getattr__ | def | function | def __getattr__(self, attr):
if not self.left:
raise RuntimeError("it's over") # pragma: no cover
self.left -= 1
return self
evil = Evil()
with pytest.raises(
ValueError,
match=(
"could not find real function of <Evil lef... |
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 46 | Evil | ref | function | evil = Evil()
|
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_compat.py | testing/test_compat.py | 48 | raises | ref | function | with pytest.raises(
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.