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/code/test_source.py
testing/code/test_source.py
246
test_getfuncsource_dynamic
def
function
def test_getfuncsource_dynamic() -> None: def f(): raise NotImplementedError() def g(): pass # pragma: no cover f_source = Source(f) g_source = Source(g) assert str(f_source).strip() == "def f():\n raise NotImplementedError()" assert str(g_source).strip() == "def g():\n ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
247
f
def
function
def f(): raise NotImplementedError() source = Source(f) assert str(source).startswith("def f():")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
250
g
def
function
def g(): pass # pragma: no cover f_source = Source(f) g_source = Source(g) assert str(f_source).strip() == "def f():\n raise NotImplementedError()" assert str(g_source).strip() == "def g():\n pass # pragma: no cover"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
253
Source
ref
function
f_source = Source(f)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
254
Source
ref
function
g_source = Source(g)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
259
test_getfuncsource_with_multine_string
def
function
def test_getfuncsource_with_multine_string() -> None: def f(): c = """while _True: pass
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
260
f
def
function
def f(): raise NotImplementedError() source = Source(f) assert str(source).startswith("def f():")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
271
Source
ref
function
assert str(Source(f)) == expected.rstrip()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
274
test_deindent
def
function
def test_deindent() -> None: from _pytest._code.source import deindent as deindent assert deindent(["\tfoo", "\tbar"]) == ["foo", "bar"] source = """\ def f(): def g(): pass """ lines = deindent(source.splitlines()) assert lines == ["def f():", " def g():...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
277
deindent
ref
function
assert deindent(["\tfoo", "\tbar"]) == ["foo", "bar"]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
284
deindent
ref
function
lines = deindent(source.splitlines())
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
288
test_source_of_class_at_eof_without_newline
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
291
Source
ref
function
source = Source(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
300
import_path
ref
function
mod: Any = import_path(path, root=tmp_path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
301
Source
ref
function
s2 = Source(mod.A)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
307
x
def
function
def x(): pass
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
311
test_source_fallback
def
function
def test_source_fallback() -> None: src = Source(x) expected = """def x(): pass""" assert str(src) == expected
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
312
Source
ref
function
src = Source(x)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
318
test_findsource_fallback
def
function
def test_findsource_fallback() -> None: from _pytest._code.source import findsource src, lineno = findsource(x) assert src is not None assert "test_findsource_simple" in str(src) assert src[lineno] == " def x():"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
327
test_findsource
def
function
def test_findsource(monkeypatch) -> None: from _pytest._code.source import findsource filename = "<pytest-test_findsource>" lines = ["if 1:\n", " def x():\n", " pass\n"] co = compile("".join(lines), filename, "exec") # Type ignored because linecache.cache is private. monkeypatch.se...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
335
setitem
ref
function
monkeypatch.setitem(linecache.cache, filename, (1, None, lines, filename)) # type: ignore[attr-defined]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
349
test_getfslineno
def
function
def test_getfslineno() -> None: def f(x) -> None: raise NotImplementedError() fspath, lineno = getfslineno(f) assert isinstance(fspath, Path) assert fspath.name == "test_source.py" assert lineno == f.__code__.co_firstlineno - 1 # see findsource class A: pass fspath, line...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
350
f
def
function
def f(x) -> None: raise NotImplementedError() fspath, lineno = getfslineno(f) assert isinstance(fspath, Path) assert fspath.name == "test_source.py" assert lineno == f.__code__.co_firstlineno - 1 # see findsource class A: pass fspath, lineno = getfslineno(A) _, A_li...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
353
getfslineno
ref
function
fspath, lineno = getfslineno(f)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
359
A
def
class
__init__ __init__
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
362
getfslineno
ref
function
fspath, lineno = getfslineno(A)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
369
getfslineno
ref
function
assert getfslineno(3) == ("", -1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
371
B
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
375
getfslineno
ref
function
assert getfslineno(B)[1] == -1
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
378
test_code_of_object_instance_with_call
def
function
def test_code_of_object_instance_with_call() -> None: class A: pass pytest.raises(TypeError, lambda: Source(A())) class WithCall: def __call__(self) -> None: pass code = Code.from_function(WithCall()) assert "pass" in str(code.source()) class Hello: def __...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
379
A
def
class
__init__ __init__
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
382
raises
ref
function
pytest.raises(TypeError, lambda: Source(A()))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
382
Source
ref
function
pytest.raises(TypeError, lambda: Source(A()))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
382
A
ref
function
pytest.raises(TypeError, lambda: Source(A()))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
384
WithCall
def
class
__call__
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
388
from_function
ref
function
code = Code.from_function(WithCall())
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
388
WithCall
ref
function
code = Code.from_function(WithCall())
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
389
source
ref
function
assert "pass" in str(code.source())
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
391
Hello
def
class
__call__
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
395
raises
ref
function
pytest.raises(TypeError, lambda: Code.from_function(Hello))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
395
from_function
ref
function
pytest.raises(TypeError, lambda: Code.from_function(Hello))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
398
getstatement
def
function
def getstatement(lineno: int, source) -> Source: from _pytest._code.source import getstatementrange_ast src = Source(source) ast, start, end = getstatementrange_ast(lineno, src) return src[start:end]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
401
Source
ref
function
src = Source(source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
402
getstatementrange_ast
ref
function
ast, start, end = getstatementrange_ast(lineno, src)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
406
test_oneline
def
function
def test_oneline() -> None: source = getstatement(0, "raise ValueError") assert str(source) == "raise ValueError"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
407
getstatement
ref
function
source = getstatement(0, "raise ValueError")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
411
test_comment_and_no_newline_at_end
def
function
def test_comment_and_no_newline_at_end() -> None: from _pytest._code.source import getstatementrange_ast source = Source( [ "def test_basic_complex():", " assert 1 == 2", "# vim: filetype=pyopencl:fdm=marker", ] ) ast, start, end = getstatementrang...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
414
Source
ref
function
source = Source(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
421
getstatementrange_ast
ref
function
ast, start, end = getstatementrange_ast(1, source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
425
test_oneline_and_comment
def
function
def test_oneline_and_comment() -> None: source = getstatement(0, "raise ValueError\n#hello") assert str(source) == "raise ValueError"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
426
getstatement
ref
function
source = getstatement(0, "raise ValueError\n#hello")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
430
test_comments
def
function
def test_comments() -> None: source = '''def test(): "comment 1" x = 1 # comment 2 # comment 3 assert _False
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
444
getstatement
ref
function
assert str(getstatement(line, source)) == " x = 1"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
449
getstatement
ref
function
assert str(getstatement(10, source)) == '"""'
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
451
getstatement
ref
function
assert str(getstatement(line, source)) == " assert False"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
453
getstatement
ref
function
assert str(getstatement(line, source)) == '"""\ncomment 4\n"""'
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
456
test_comment_in_statement
def
function
def test_comment_in_statement() -> None: source = """test(foo=1, # comment 1 bar=2)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
463
getstatement
ref
function
str(getstatement(line, source))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
468
test_source_with_decorator
def
function
def test_source_with_decorator() -> None: """Test behavior with Source / Code().source with regard to decorators.""" from _pytest.compat import get_real_func @pytest.mark.foo def deco_mark(): assert _False src = inspect.getsource(deco_mark) assert textwrap.indent(str(Source(deco_mark))...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
473
deco_mark
def
function
def deco_mark(): assert _False src = inspect.getsource(deco_mark) assert textwrap.indent(str(Source(deco_mark)), " ") + "\n" == src assert src.startswith(" @pytest.mark.foo") @pytest.fixture def deco_fixture(): assert _False src = inspect.getsource(deco_fixture) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
477
Source
ref
function
assert textwrap.indent(str(Source(deco_mark)), " ") + "\n" == src
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
481
deco_fixture
def
function
def deco_fixture(): assert _False src = inspect.getsource(deco_fixture) assert src == " @pytest.fixture\n def deco_fixture():\n assert _False\n" # currenly Source does not unwrap decorators, testing the # existing behavior here for explicitness, but perhaps we should revisit/ch...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
489
Source
ref
function
assert str(Source(deco_fixture)).startswith("@functools.wraps(function)")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
491
Source
ref
function
textwrap.indent(str(Source(get_real_func(deco_fixture))), " ") + "\n" == src
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
491
get_real_func
ref
function
textwrap.indent(str(Source(get_real_func(deco_fixture))), " ") + "\n" == src
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
495
test_single_line_else
def
function
def test_single_line_else() -> None: source = getstatement(1, "if _False: 2\nelse: 3") assert str(source) == "else: 3"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
496
getstatement
ref
function
source = getstatement(1, "if False: 2\nelse: 3")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
500
test_single_line_finally
def
function
def test_single_line_finally() -> None: source = getstatement(1, "try: 1\nfinally: 3") assert str(source) == "finally: 3"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
501
getstatement
ref
function
source = getstatement(1, "try: 1\nfinally: 3")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
505
test_issue55
def
function
def test_issue55() -> None: source = ( "def round_trip(dinp):\n assert 1 == dinp\n" 'def test_rt():\n round_trip("""\n""")\n' ) s = getstatement(3, source) assert str(s) == ' round_trip("""\n""")'
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
510
getstatement
ref
function
s = getstatement(3, source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
514
test_multiline
def
function
def test_multiline() -> None: source = getstatement( 0, """\
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
515
getstatement
ref
function
source = getstatement(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
527
TestTry
def
class
setup_class test_body test_except_line test_except_body test_else
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
528
setup_class
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
538
test_body
def
function
def test_body(self) -> None: source = getstatement(1, self.source) assert str(source) == " raise ValueError" def test_except_line(self) -> None: source = getstatement(2, self.source) assert str(source) == "except Something:" def test_except_body(self) -> None: so...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
539
getstatement
ref
function
source = getstatement(1, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
542
test_except_line
def
function
def test_except_line(self) -> None: source = getstatement(2, self.source) assert str(source) == "except Something:" def test_except_body(self) -> None: source = getstatement(3, self.source) assert str(source) == " raise IndexError(1)" def test_else(self) -> None: ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
543
getstatement
ref
function
source = getstatement(2, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
546
test_except_body
def
function
def test_except_body(self) -> None: source = getstatement(3, self.source) assert str(source) == " raise IndexError(1)" def test_else(self) -> None: source = getstatement(5, self.source) assert str(source) == " raise KeyError()"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
547
getstatement
ref
function
source = getstatement(3, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
550
test_else
def
function
def test_else(self) -> None: source = getstatement(5, self.source) assert str(source) == " raise KeyError()"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
551
getstatement
ref
function
source = getstatement(5, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
555
TestTryFinally
def
class
setup_class test_body test_finally
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
556
setup_class
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
564
test_body
def
function
def test_body(self) -> None: source = getstatement(1, self.source) assert str(source) == " raise ValueError" def test_except_line(self) -> None: source = getstatement(2, self.source) assert str(source) == "except Something:" def test_except_body(self) -> None: so...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
565
getstatement
ref
function
source = getstatement(1, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
568
test_finally
def
function
def test_finally(self) -> None: source = getstatement(3, self.source) assert str(source) == " raise IndexError(1)"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
569
getstatement
ref
function
source = getstatement(3, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
573
TestIf
def
class
setup_class test_body test_elif_clause test_elif test_else
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
574
setup_class
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
584
test_body
def
function
def test_body(self) -> None: source = getstatement(1, self.source) assert str(source) == " raise ValueError" def test_except_line(self) -> None: source = getstatement(2, self.source) assert str(source) == "except Something:" def test_except_body(self) -> None: so...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
585
getstatement
ref
function
source = getstatement(1, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
588
test_elif_clause
def
function
def test_elif_clause(self) -> None: source = getstatement(2, self.source) assert str(source) == "elif _False:" def test_elif(self) -> None: source = getstatement(3, self.source) assert str(source) == " y = 5" def test_else(self) -> None: source = getstatement(5, ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
589
getstatement
ref
function
source = getstatement(2, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
592
test_elif
def
function
def test_elif(self) -> None: source = getstatement(3, self.source) assert str(source) == " y = 5" def test_else(self) -> None: source = getstatement(5, self.source) assert str(source) == " y = 7"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
593
getstatement
ref
function
source = getstatement(3, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
596
test_else
def
function
def test_else(self) -> None: source = getstatement(5, self.source) assert str(source) == " raise KeyError()"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
597
getstatement
ref
function
source = getstatement(5, self.source)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_source.py
testing/code/test_source.py
601
test_semicolon
def
function
def test_semicolon() -> None: s = """\