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_error_diffs.py | testing/test_error_diffs.py | 110 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 134 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 156 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 180 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 197 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 216 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 244 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 276 | parametrize | ref | function | @pytest.mark.parametrize("code, expected", TESTCASES)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 277 | test_error_diff | def | function | def test_error_diff(code: str, expected: str, pytester: Pytester) -> None:
expected_lines = [line.lstrip() for line in expected.splitlines()]
p = pytester.makepyfile(code)
result = pytester.runpytest(p, "-vv")
result.stdout.fnmatch_lines(expected_lines)
assert result.ret == 1
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 279 | makepyfile | ref | function | p = pytester.makepyfile(code)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 280 | runpytest | ref | function | result = pytester.runpytest(p, "-vv")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_error_diffs.py | testing/test_error_diffs.py | 281 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(expected_lines)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 7 | test_enabled | def | function | def test_enabled(pytester: Pytester) -> None:
"""Test single crashing test displays a traceback."""
pytester.makepyfile(
"""
import faulthandler
def test_crash():
faulthandler._sigabrt()
"""
)
result = pytester.runpytest_subprocess()
result.stderr.fnmatch_lines(["*Fatal P... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 9 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 16 | runpytest_subprocess | ref | function | result = pytester.runpytest_subprocess()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 17 | fnmatch_lines | ref | function | result.stderr.fnmatch_lines(["*Fatal Python error*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 21 | setup_crashing_test | def | function | def setup_crashing_test(pytester: Pytester) -> None:
pytester.makepyfile(
"""
import faulthandler
import atexit
def test_ok():
atexit.register(faulthandler._sigabrt)
"""
)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 22 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 32 | test_crash_during_shutdown_captured | def | function | def test_crash_during_shutdown_captured(pytester: Pytester) -> None:
"""
Re-enable faulthandler if pytest encountered it enabled during configure.
We should be able to then see crashes during interpreter shutdown.
"""
setup_crashing_test(pytester)
args = (sys.executable, "-Xfaulthandler", "-mpyt... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 37 | setup_crashing_test | ref | function | setup_crashing_test(pytester)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 39 | run | ref | function | result = pytester.run(*args)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 40 | fnmatch_lines | ref | function | result.stderr.fnmatch_lines(["*Fatal Python error*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 44 | test_crash_during_shutdown_not_captured | def | function | def test_crash_during_shutdown_not_captured(pytester: Pytester) -> None:
"""
Check that pytest leaves faulthandler disabled if it was not enabled during configure.
This prevents us from seeing crashes during interpreter shutdown (see #8260).
"""
setup_crashing_test(pytester)
args = (sys.executab... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 49 | setup_crashing_test | ref | function | setup_crashing_test(pytester)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 51 | run | ref | function | result = pytester.run(*args)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 52 | no_fnmatch_line | ref | function | result.stderr.no_fnmatch_line("*Fatal Python error*")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 56 | test_disabled | def | function | def test_disabled(pytester: Pytester) -> None:
"""Test option to disable fault handler in the command line."""
pytester.makepyfile(
"""
import faulthandler
def test_disabled():
assert not faulthandler.is_enabled()
"""
)
result = pytester.runpytest_subprocess("-p", "no:faultha... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 58 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 65 | runpytest_subprocess | ref | function | result = pytester.runpytest_subprocess("-p", "no:faulthandler")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 66 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*1 passed*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 70 | parametrize | ref | function | @pytest.mark.parametrize(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 73 | param | ref | function | pytest.param(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 74 | skip | ref | function | True, marks=pytest.mark.skip(reason="sometimes crashes on CI (#7022)")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 79 | test_timeout | def | function | def test_timeout(pytester: Pytester, enabled: bool) -> None:
"""Test option to dump tracebacks after a certain timeout.
If faulthandler is disabled, no traceback will be dumped.
"""
pytester.makepyfile(
"""
import os, time
def test_timeout():
time.sleep(1 if "CI" in os.environ e... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 84 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 91 | makeini | ref | function | pytester.makeini(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 99 | runpytest_subprocess | ref | function | result = pytester.runpytest_subprocess(*args)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 102 | fnmatch_lines | ref | function | result.stderr.fnmatch_lines(["*%s*" % tb_output])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 105 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*1 passed*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 109 | parametrize | ref | function | @pytest.mark.parametrize("hook_name", ["pytest_enter_pdb", "pytest_exception_interact"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 110 | test_cancel_timeout_on_hook | def | function | def test_cancel_timeout_on_hook(monkeypatch, hook_name) -> None:
"""Make sure that we are cancelling any scheduled traceback dumping due
to timeout before entering pdb (pytest-dev/pytest-faulthandler#12) or any
other interactive exception (pytest-dev/pytest-faulthandler#14)."""
import faulthandler
f... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 126 | hook_func | ref | function | hook_func()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 130 | test_already_initialized_crash | def | function | def test_already_initialized_crash(pytester: Pytester) -> None:
"""Even if faulthandler is already initialized, we still dump tracebacks on crashes (#8258)."""
pytester.makepyfile(
"""
def test():
import faulthandler
faulthandler._sigabrt()
"""
)
result = pyte... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 132 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 139 | run | ref | function | result = pytester.run(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 146 | fnmatch_lines | ref | function | result.stderr.fnmatch_lines(["*Fatal Python error*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 150 | test_get_stderr_fileno_invalid_fd | def | function | def test_get_stderr_fileno_invalid_fd() -> None:
"""Test for faulthandler being able to handle invalid file descriptors for stderr (#8249)."""
from _pytest.faulthandler import get_stderr_fileno
class StdErrWrapper(io.StringIO):
"""
Mimic ``twisted.logger.LoggingFile`` to simulate returning ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 154 | StdErrWrapper | def | class | fileno |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 161 | fileno | def | function | def fileno(self):
return -1
wrapper = StdErrWrapper()
with pytest.MonkeyPatch.context() as mp:
mp.setattr("sys.stderr", wrapper)
# Even when the stderr wrapper signals an invalid file descriptor,
# ``_get_stderr_fileno()`` should return the real one.
assert... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 164 | StdErrWrapper | ref | function | wrapper = StdErrWrapper()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 166 | context | ref | function | with pytest.MonkeyPatch.context() as mp:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_faulthandler.py | testing/test_faulthandler.py | 171 | get_stderr_fileno | ref | function | assert get_stderr_fileno() == 2
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 10 | TestLoadConfigDictFromFile | def | class | test_empty_pytest_ini test_pytest_ini test_custom_ini test_custom_ini_without_section test_custom_cfg_file test_valid_cfg_file test_unsupported_pytest_section_in_cfg_file test_invalid_toml_file test_custom_toml_file test_valid_toml_file |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 11 | test_empty_pytest_ini | def | function | def test_empty_pytest_ini(self, tmp_path: Path) -> None:
"""pytest.ini files are always considered for configuration, even if empty"""
fn = tmp_path / "pytest.ini"
fn.write_text("", encoding="utf-8")
assert load_config_dict_from_file(fn) == {}
def test_pytest_ini(self, tmp_path:... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 15 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) == {}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 17 | test_pytest_ini | def | function | def test_pytest_ini(self, tmp_path: Path) -> None:
"""[pytest] section in pytest.ini files is read correctly"""
fn = tmp_path / "pytest.ini"
fn.write_text("[pytest]\nx=1", encoding="utf-8")
assert load_config_dict_from_file(fn) == {"x": "1"}
def test_custom_ini(self, tmp_path: P... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 21 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) == {"x": "1"}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 23 | test_custom_ini | def | function | def test_custom_ini(self, tmp_path: Path) -> None:
"""[pytest] section in any .ini file is read correctly"""
fn = tmp_path / "custom.ini"
fn.write_text("[pytest]\nx=1", encoding="utf-8")
assert load_config_dict_from_file(fn) == {"x": "1"}
def test_custom_ini_without_section(self... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 27 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) == {"x": "1"}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 29 | test_custom_ini_without_section | def | function | def test_custom_ini_without_section(self, tmp_path: Path) -> None:
"""Custom .ini files without [pytest] section are not considered for configuration"""
fn = tmp_path / "custom.ini"
fn.write_text("[custom]", encoding="utf-8")
assert load_config_dict_from_file(fn) is None
def tes... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 33 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) is None
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 35 | test_custom_cfg_file | def | function | def test_custom_cfg_file(self, tmp_path: Path) -> None:
"""Custom .cfg files without [tool:pytest] section are not considered for configuration"""
fn = tmp_path / "custom.cfg"
fn.write_text("[custom]", encoding="utf-8")
assert load_config_dict_from_file(fn) is None
def test_vali... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 39 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) is None
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 41 | test_valid_cfg_file | def | function | def test_valid_cfg_file(self, tmp_path: Path) -> None:
"""Custom .cfg files with [tool:pytest] section are read correctly"""
fn = tmp_path / "custom.cfg"
fn.write_text("[tool:pytest]\nx=1", encoding="utf-8")
assert load_config_dict_from_file(fn) == {"x": "1"}
def test_unsupporte... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 45 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) == {"x": "1"}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 47 | test_unsupported_pytest_section_in_cfg_file | def | function | def test_unsupported_pytest_section_in_cfg_file(self, tmp_path: Path) -> None:
""".cfg files with [pytest] section are no longer supported and should fail to alert users"""
fn = tmp_path / "custom.cfg"
fn.write_text("[pytest]", encoding="utf-8")
with pytest.raises(pytest.fail.Excepti... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 51 | raises | ref | function | with pytest.raises(pytest.fail.Exception):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 52 | load_config_dict_from_file | ref | function | load_config_dict_from_file(fn)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 54 | test_invalid_toml_file | def | function | def test_invalid_toml_file(self, tmp_path: Path) -> None:
"""Invalid .toml files should raise `UsageError`."""
fn = tmp_path / "myconfig.toml"
fn.write_text("]invalid toml[", encoding="utf-8")
with pytest.raises(UsageError):
load_config_dict_from_file(fn)
def test_cu... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 58 | raises | ref | function | with pytest.raises(UsageError):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 59 | load_config_dict_from_file | ref | function | load_config_dict_from_file(fn)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 61 | test_custom_toml_file | def | function | def test_custom_toml_file(self, tmp_path: Path) -> None:
""".toml files without [tool.pytest.ini_options] are not considered for configuration."""
fn = tmp_path / "myconfig.toml"
fn.write_text(
dedent(
"""
[build_system]
x = 1
"... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 73 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) is None
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 75 | test_valid_toml_file | def | function | def test_valid_toml_file(self, tmp_path: Path) -> None:
""".toml files with [tool.pytest.ini_options] are read correctly, including changing
data types to str/list for compatibility with other configuration options."""
fn = tmp_path / "myconfig.toml"
fn.write_text(
dedent... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 92 | load_config_dict_from_file | ref | function | assert load_config_dict_from_file(fn) == {
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 101 | TestCommonAncestor | def | class | test_has_ancestor test_single_dir test_single_file |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 102 | test_has_ancestor | def | function | def test_has_ancestor(self, tmp_path: Path) -> None:
fn1 = tmp_path / "foo" / "bar" / "test_1.py"
fn1.parent.mkdir(parents=_True)
fn1.touch()
fn2 = tmp_path / "foo" / "zaz" / "test_2.py"
fn2.parent.mkdir(parents=_True)
fn2.touch()
assert get_common_ancestor([f... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 109 | get_common_ancestor | ref | function | assert get_common_ancestor([fn1, fn2]) == tmp_path / "foo"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 110 | get_common_ancestor | ref | function | assert get_common_ancestor([fn1.parent, fn2]) == tmp_path / "foo"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 111 | get_common_ancestor | ref | function | assert get_common_ancestor([fn1.parent, fn2.parent]) == tmp_path / "foo"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 112 | get_common_ancestor | ref | function | assert get_common_ancestor([fn1, fn2.parent]) == tmp_path / "foo"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 114 | test_single_dir | def | function | def test_single_dir(self, tmp_path: Path) -> None:
assert get_common_ancestor([tmp_path]) == tmp_path
def test_single_file(self, tmp_path: Path) -> None:
fn = tmp_path / "foo.py"
fn.touch()
assert get_common_ancestor([fn]) == tmp_path
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 115 | get_common_ancestor | ref | function | assert get_common_ancestor([tmp_path]) == tmp_path
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 117 | test_single_file | def | function | def test_single_file(self, tmp_path: Path) -> None:
fn = tmp_path / "foo.py"
fn.touch()
assert get_common_ancestor([fn]) == tmp_path
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 120 | get_common_ancestor | ref | function | assert get_common_ancestor([fn]) == tmp_path
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 123 | test_get_dirs_from_args | def | function | def test_get_dirs_from_args(tmp_path):
"""get_dirs_from_args() skips over non-existing directories and files"""
fn = tmp_path / "foo.py"
fn.touch()
d = tmp_path / "tests"
d.mkdir()
option = "--foobar=/foo.txt"
# xdist uses options in this format for its rsync feature (#7638)
xdist_rsync_... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_findpaths.py | testing/test_findpaths.py | 132 | get_dirs_from_args | ref | function | assert get_dirs_from_args(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 5 | test_version_verbose | def | function | def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
result = pytester.runpytest("--version", "--version")
assert result.ret == 0
result.stdout.fnmatch_lines([f"*pytest*{pytest.__version__}*imported from*"])
if pytestco... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 6 | delenv | ref | function | monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 7 | runpytest | ref | function | result = pytester.runpytest("--version", "--version")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 9 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines([f"*pytest*{pytest.__version__}*imported from*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 10 | list_plugin_distinfo | ref | function | if pytestconfig.pluginmanager.list_plugin_distinfo():
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 11 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*setuptools registered plugins:", "*at*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 14 | test_version_less_verbose | def | function | def test_version_less_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
result = pytester.runpytest("--version")
assert result.ret == 0
result.stdout.fnmatch_lines([f"pytest {pytest.__version__}"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 15 | delenv | ref | function | monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 16 | runpytest | ref | function | result = pytester.runpytest("--version")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 18 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines([f"pytest {pytest.__version__}"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 21 | test_versions | def | function | def test_versions():
"""Regression check for the public version attributes in pytest."""
assert isinstance(pytest.__version__, str)
assert isinstance(pytest.version_tuple, tuple)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 27 | test_help | def | function | def test_help(pytester: Pytester) -> None:
result = pytester.runpytest("--help")
assert result.ret == 0
result.stdout.fnmatch_lines(
"""
-m MARKEXPR only run tests matching given mark expression.
For example: -m 'mark1 and not mark2'.
repor... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_helpconfig.py | testing/test_helpconfig.py | 28 | runpytest | ref | function | result = pytester.runpytest("--help")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.