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_main.py
testing/test_main.py
175
raises
ref
function
with pytest.raises(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
178
resolve_collection_argument
ref
function
resolve_collection_argument(invocation_path, "foobar")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
180
raises
ref
function
with pytest.raises(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
186
resolve_collection_argument
ref
function
resolve_collection_argument(invocation_path, "foobar", as_pypath=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
188
test_absolute_paths_are_resolved_correctly
def
function
def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> None: """Absolute paths resolve back to absolute paths.""" full_path = str(invocation_path / "src") assert resolve_collection_argument(invocation_path, full_path) == ( Path(os.path.abspath("src")), ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
191
resolve_collection_argument
ref
function
assert resolve_collection_argument(invocation_path, full_path) == (
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
192
abspath
ref
function
Path(os.path.abspath("src")),
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
198
splitdrive
ref
function
drive, full_path_without_drive = os.path.splitdrive(full_path)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
199
resolve_collection_argument
ref
function
assert resolve_collection_argument(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
201
abspath
ref
function
) == (Path(os.path.abspath("src")), [])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
204
test_module_full_path_without_drive
def
function
def test_module_full_path_without_drive(pytester: Pytester) -> None: """Collect and run test using full path except for the drive letter (#7628). Passing a full path without a drive letter would trigger a bug in legacy_path where it would keep the full path without the drive letter around, instead of resol...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
211
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
221
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
232
splitdrive
ref
function
drive, path = os.path.splitdrive(str(fn))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
234
runpytest
ref
function
result = pytester.runpytest(path, "-v")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_main.py
testing/test_main.py
235
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
15
TestMark
def
class
test_pytest_exists_in_namespace_all test_pytest_mark_notcallable test_mark_with_param test_pytest_mark_name_starts_with_underscore
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
16
parametrize
ref
function
@pytest.mark.parametrize("attr", ["mark", "param"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
17
parametrize
ref
function
@pytest.mark.parametrize("modulename", ["py.test", "pytest"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
18
test_pytest_exists_in_namespace_all
def
function
def test_pytest_exists_in_namespace_all(self, attr: str, modulename: str) -> None: module = sys.modules[modulename] assert attr in module.__all__ # type: ignore def test_pytest_mark_notcallable(self) -> None: mark = MarkGenerator(_ispytest=_True) with pytest.raises(TypeError): ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
22
test_pytest_mark_notcallable
def
function
def test_pytest_mark_notcallable(self) -> None: mark = MarkGenerator(_ispytest=_True) with pytest.raises(TypeError): mark() # type: ignore[operator] def test_mark_with_param(self): def some_function(abc): pass class SomeClass: pass ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
23
MarkGenerator
ref
function
mark = MarkGenerator(_ispytest=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
24
raises
ref
function
with pytest.raises(TypeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
25
mark
ref
function
mark() # type: ignore[operator]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
27
test_mark_with_param
def
function
def test_mark_with_param(self): def some_function(abc): pass class SomeClass: pass assert pytest.mark.foo(some_function) is some_function marked_with_args = pytest.mark.foo.with_args(some_function) assert marked_with_args is not some_function # type...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
28
some_function
def
function
def some_function(abc): pass class SomeClass: pass assert pytest.mark.foo(some_function) is some_function marked_with_args = pytest.mark.foo.with_args(some_function) assert marked_with_args is not some_function # type: ignore[comparison-overlap] ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
31
SomeClass
def
class
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
34
foo
ref
function
assert pytest.mark.foo(some_function) is some_function
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
35
with_args
ref
function
marked_with_args = pytest.mark.foo.with_args(some_function)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
38
foo
ref
function
assert pytest.mark.foo(SomeClass) is SomeClass
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
39
with_args
ref
function
assert pytest.mark.foo.with_args(SomeClass) is not SomeClass # type: ignore[comparison-overlap]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
41
test_pytest_mark_name_starts_with_underscore
def
function
def test_pytest_mark_name_starts_with_underscore(self) -> None: mark = MarkGenerator(_ispytest=_True) with pytest.raises(AttributeError): mark._some_name
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
42
MarkGenerator
ref
function
mark = MarkGenerator(_ispytest=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
43
raises
ref
function
with pytest.raises(AttributeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
47
test_marked_class_run_twice
def
class
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
51
makepyfile
ref
function
py_file = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
60
basename
ref
function
file_name = os.path.basename(py_file)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
61
inline_run
ref
function
rec = pytester.inline_run(file_name, file_name)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
62
assertoutcome
ref
function
rec.assertoutcome(passed=6)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
65
test_ini_markers
def
function
def test_ini_markers(pytester: Pytester) -> None: pytester.makeini( """ [pytest] markers = a1: this is a webtest marker a2: this is a smoke marker """ ) pytester.makepyfile( """ def test_markers(pytestconfig): markers = pytestco...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
66
makeini
ref
function
pytester.makeini(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
74
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
84
inline_run
ref
function
rec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
85
assertoutcome
ref
function
rec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
88
test_markers_option
def
function
def test_markers_option(pytester: Pytester) -> None: pytester.makeini( """ [pytest] markers = a1: this is a webtest marker a1some: another marker nodescription """ ) result = pytester.runpytest("--markers") result.stdout.fnmatch_lines( ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
89
makeini
ref
function
pytester.makeini(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
98
runpytest
ref
function
result = pytester.runpytest("--markers")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
99
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
104
test_ini_markers_whitespace
def
function
def test_ini_markers_whitespace(pytester: Pytester) -> None: pytester.makeini( """ [pytest] markers = a1 : this is a whitespace marker """ ) pytester.makepyfile( """ import pytest @pytest.mark.a1 def test_markers(): assert ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
105
makeini
ref
function
pytester.makeini(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
112
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
121
inline_run
ref
function
rec = pytester.inline_run("--strict-markers", "-m", "a1")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
122
assertoutcome
ref
function
rec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
125
test_marker_without_description
def
function
def test_marker_without_description(pytester: Pytester) -> None: pytester.makefile( ".cfg", setup=""" [tool:pytest] markers=slow """, ) pytester.makeconftest( """ import pytest pytest.mark.xfail('FAIL') """ ) ftdir = pytester.mkdir("ft1...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
126
makefile
ref
function
pytester.makefile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
133
makeconftest
ref
function
pytester.makeconftest(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
140
joinpath
ref
function
pytester.path.joinpath("conftest.py").replace(ftdir.joinpath("conftest.py"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
140
joinpath
ref
function
pytester.path.joinpath("conftest.py").replace(ftdir.joinpath("conftest.py"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
141
runpytest
ref
function
rec = pytester.runpytest("--strict-markers")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
142
assert_outcomes
ref
function
rec.assert_outcomes()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
145
test_markers_option_with_plugin_in_current_dir
def
function
def test_markers_option_with_plugin_in_current_dir(pytester: Pytester) -> None: pytester.makeconftest('pytest_plugins = "flip_flop"') pytester.makepyfile( flip_flop="""\ def pytest_configure(config): config.addinivalue_line("markers", "flip:flop") def pytest_generate_tests(m...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
146
makeconftest
ref
function
pytester.makeconftest('pytest_plugins = "flip_flop"')
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
147
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
159
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
167
runpytest
ref
function
result = pytester.runpytest("--markers")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
168
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*flip*flop*"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
171
test_mark_on_pseudo_function
def
function
def test_mark_on_pseudo_function(pytester: Pytester) -> None: pytester.makepyfile( """ import pytest @pytest.mark.r(lambda x: 0/0) def test_hello(): pass """ ) reprec = pytester.inline_run() reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
172
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
181
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
182
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
185
parametrize
ref
function
@pytest.mark.parametrize("option_name", ["--strict-markers", "--strict"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
186
test_strict_prohibits_unregistered_markers
def
function
def test_strict_prohibits_unregistered_markers( pytester: Pytester, option_name: str
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
189
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
197
runpytest
ref
function
result = pytester.runpytest(option_name)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
199
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
204
parametrize
ref
function
@pytest.mark.parametrize(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
215
test_mark_option
def
function
def test_mark_option( expr: str, expected_passed: List[Optional[str]], pytester: Pytester
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
218
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
229
inline_run
ref
function
rec = pytester.inline_run("-m", expr)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
230
listoutcomes
ref
function
passed, skipped, fail = rec.listoutcomes()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
235
parametrize
ref
function
@pytest.mark.parametrize(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
239
test_mark_option_custom
def
function
def test_mark_option_custom( expr: str, expected_passed: List[str], pytester: Pytester
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
242
makeconftest
ref
function
pytester.makeconftest(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
251
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
259
inline_run
ref
function
rec = pytester.inline_run("-m", expr)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
260
listoutcomes
ref
function
passed, skipped, fail = rec.listoutcomes()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
265
parametrize
ref
function
@pytest.mark.parametrize(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
277
test_keyword_option_custom
def
function
def test_keyword_option_custom( expr: str, expected_passed: List[str], pytester: Pytester
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
280
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
294
inline_run
ref
function
rec = pytester.inline_run("-k", expr)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
295
listoutcomes
ref
function
passed, skipped, fail = rec.listoutcomes()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
300
test_keyword_option_considers_mark
def
function
def test_keyword_option_considers_mark(pytester: Pytester) -> None: pytester.copy_example("marks/marks_considered_keywords") rec = pytester.inline_run("-k", "foo") passed = rec.listoutcomes()[0] assert len(passed) == 1
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
301
copy_example
ref
function
pytester.copy_example("marks/marks_considered_keywords")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
302
inline_run
ref
function
rec = pytester.inline_run("-k", "foo")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
303
listoutcomes
ref
function
passed = rec.listoutcomes()[0]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
307
parametrize
ref
function
@pytest.mark.parametrize(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
315
test_keyword_option_parametrize
def
function
def test_keyword_option_parametrize( expr: str, expected_passed: List[str], pytester: Pytester
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
318
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
326
inline_run
ref
function
rec = pytester.inline_run("-k", expr)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_mark.py
testing/test_mark.py
327
listoutcomes
ref
function
passed, skipped, fail = rec.listoutcomes()