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_assertion.py | testing/test_assertion.py | 1,619 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,628 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,629 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,634 | test_issue_1944 | def | function | def test_issue_1944(pytester: Pytester) -> None:
pytester.makepyfile(
"""
def f():
return
assert f() == 10
"""
)
result = pytester.runpytest()
result.stdout.fnmatch_lines(["*1 error*"])
assert (
"AttributeError: 'Module' object has no attribute '_obj'... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,635 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,643 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,644 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*1 error*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,651 | test_exit_from_assertrepr_compare | def | function | def test_exit_from_assertrepr_compare(monkeypatch) -> None:
def raise_exit(obj):
outcomes.exit("Quitting debugger")
monkeypatch.setattr(util, "istext", raise_exit)
with pytest.raises(outcomes.Exit, match="Quitting debugger"):
callequal(1, 1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,652 | raise_exit | def | function | def raise_exit(obj):
outcomes.exit("Quitting debugger")
monkeypatch.setattr(util, "istext", raise_exit)
with pytest.raises(outcomes.Exit, match="Quitting debugger"):
callequal(1, 1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,657 | raises | ref | function | with pytest.raises(outcomes.Exit, match="Quitting debugger"):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,658 | callequal | ref | function | callequal(1, 1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,661 | test_assertion_location_with_coverage | def | function | def test_assertion_location_with_coverage(pytester: Pytester) -> None:
"""This used to report the wrong location when run with coverage (#5754)."""
p = pytester.makepyfile(
"""
def test():
assert _False, 1
assert _False, 2
"""
)
result = pytester.runpytest... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,663 | makepyfile | ref | function | p = pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,670 | runpytest | ref | function | result = pytester.runpytest(str(p))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertion.py | testing/test_assertion.py | 1,671 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 37 | rewrite | def | function | def rewrite(src: str) -> ast.Module:
tree = ast.parse(src)
rewrite_asserts(tree, src.encode())
return tree
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 39 | rewrite_asserts | ref | function | rewrite_asserts(tree, src.encode())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 43 | getmsg | def | function | def getmsg(
f, extra_ns: Optional[Mapping[str, object]] = None, *, must_pass: bool = _False
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 47 | from_function | ref | function | src = "\n".join(_pytest._code.Code.from_function(f).source().lines)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 47 | source | ref | function | src = "\n".join(_pytest._code.Code.from_function(f).source().lines)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 48 | rewrite | ref | function | mod = rewrite(src)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 56 | func | ref | function | func() # type: ignore[operator]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 59 | fail | ref | function | pytest.fail("shouldn't have raised")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 66 | fail | ref | function | pytest.fail("function didn't raise at all")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 70 | TestAssertionRewrite | def | class | test_place_initial_imports test_location_is_set test_dont_rewrite test_dont_rewrite_plugin test_rewrites_plugin_as_a_package test_honors_pep_235 test_name test_assertrepr_compare_same_width test_dont_rewrite_if_hasattr_fails test_assert_already_has_message test_assertion_message test_assertion_message_multiline test_as... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 71 | test_place_initial_imports | def | function | def test_place_initial_imports(self) -> None:
s = """'Doc string'\nother = stuff"""
m = rewrite(s)
assert isinstance(m.body[0], ast.Expr)
for imp in m.body[1:3]:
assert isinstance(imp, ast.Import)
assert imp.lineno == 2
assert imp.col_offset == 0
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 73 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 81 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 89 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 97 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 106 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 113 | test_location_is_set | def | function | def test_location_is_set(self) -> None:
s = textwrap.dedent(
"""
assert _False, (
"Ouch"
)
"""
)
m = rewrite(s)
for node in m.body:
if isinstance(node, ast.Import):
continue
for n in [node, *... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 124 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 135 | test_dont_rewrite | def | function | def test_dont_rewrite(self) -> None:
s = """'PYTEST_DONT_REWRITE'\nassert 14"""
m = rewrite(s)
assert len(m.body) == 2
assert isinstance(m.body[1], ast.Assert)
assert m.body[1].msg is None
def test_dont_rewrite_plugin(self, pytester: Pytester) -> None:
contents =... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 137 | rewrite | ref | function | m = rewrite(s)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 142 | test_dont_rewrite_plugin | def | function | def test_dont_rewrite_plugin(self, pytester: Pytester) -> None:
contents = {
"conftest.py": "pytest_plugins = 'plugin'; import plugin",
"plugin.py": "'PYTEST_DONT_REWRITE'",
"test_foo.py": "def test_foo(): pass",
}
pytester.makepyfile(**contents)
r... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 148 | makepyfile | ref | function | pytester.makepyfile(**contents)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 149 | runpytest_subprocess | ref | function | result = pytester.runpytest_subprocess()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 152 | test_rewrites_plugin_as_a_package | def | function | def test_rewrites_plugin_as_a_package(self, pytester: Pytester) -> None:
pkgdir = pytester.mkpydir("plugin")
pkgdir.joinpath("__init__.py").write_text(
"import pytest\n"
"@pytest.fixture\n"
"def special_asserter():\n"
" def special_assert(x, y):\n"
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 153 | mkpydir | ref | function | pkgdir = pytester.mkpydir("plugin")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 162 | makeconftest | ref | function | pytester.makeconftest('pytest_plugins = ["plugin"]')
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 163 | makepyfile | ref | function | pytester.makepyfile("def test(special_asserter): special_asserter(1, 2)\n")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 164 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 165 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*assert 1 == 2*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 167 | test_honors_pep_235 | def | function | def test_honors_pep_235(self, pytester: Pytester, monkeypatch) -> None:
# note: couldn't make it fail on macos with a single `sys.path` entry
# note: these modules are named `test_*` to trigger rewriting
pytester.makepyfile(test_y="x = 1")
xdir = pytester.mkdir("x")
pytester.... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 170 | makepyfile | ref | function | pytester.makepyfile(test_y="x = 1")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 172 | mkpydir | ref | function | pytester.mkpydir(str(xdir.joinpath("test_Y")))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 174 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 181 | syspath_prepend | ref | function | monkeypatch.syspath_prepend(str(xdir))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 182 | runpytest | ref | function | pytester.runpytest().assert_outcomes(passed=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 182 | assert_outcomes | ref | function | pytester.runpytest().assert_outcomes(passed=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 184 | test_name | def | function | def test_name(self, request) -> None:
def f1() -> None:
assert _False
assert getmsg(f1) == "assert _False"
def f2() -> None:
f = _False
assert f
assert getmsg(f2) == "assert _False"
def f3() -> None:
assert a_global # type:... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 185 | f1 | def | function | def f1() -> None:
assert _False
assert getmsg(f1) == "assert _False"
def f2() -> None:
f = _False
assert f
assert getmsg(f2) == "assert _False"
def f3() -> None:
assert a_global # type: ignore[name-defined] # noqa
asse... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 188 | getmsg | ref | function | assert getmsg(f1) == "assert False"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 190 | f2 | def | function | def f2() -> None:
f = _False
assert f
assert getmsg(f2) == "assert _False"
def f3() -> None:
assert a_global # type: ignore[name-defined] # noqa
assert getmsg(f3, {"a_global": _False}) == "assert _False"
def f4() -> None:
asser... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 194 | getmsg | ref | function | assert getmsg(f2) == "assert False"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 196 | f3 | def | function | def f3() -> None:
assert a_global # type: ignore[name-defined] # noqa
assert getmsg(f3, {"a_global": _False}) == "assert _False"
def f4() -> None:
assert sys == 42 # type: ignore[comparison-overlap]
verbose = request.config.getoption("verbose")
msg = ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 199 | getmsg | ref | function | assert getmsg(f3, {"a_global": False}) == "assert False"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 201 | f4 | def | function | def f4() -> None:
assert sys == 42 # type: ignore[comparison-overlap]
verbose = request.config.getoption("verbose")
msg = getmsg(f4, {"sys": sys})
if verbose > 0:
assert msg == (
"assert <module 'sys' (built-in)> == 42\n"
" +<mod... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 204 | getoption | ref | function | verbose = request.config.getoption("verbose")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 205 | getmsg | ref | function | msg = getmsg(f4, {"sys": sys})
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 215 | f5 | def | function | def f5() -> None:
assert cls == 42 # type: ignore[name-defined] # noqa: F821
class X:
pass
msg = getmsg(f5, {"cls": X})
assert msg is not None
lines = msg.splitlines()
if verbose > 1:
assert lines == [
f"assert {X!r}... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 218 | X | def | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 221 | getmsg | ref | function | msg = getmsg(f5, {"cls": X})
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 239 | test_assertrepr_compare_same_width | def | function | def test_assertrepr_compare_same_width(self, request) -> None:
"""Should use same width/truncation with same initial width."""
def f() -> None:
assert "1234567890" * 5 + "A" == "1234567890" * 5 + "B"
msg = getmsg(f)
assert msg is not None
line = msg.splitlines()... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 242 | f | def | function | def f() -> None:
assert "1234567890" * 5 + "A" == "1234567890" * 5 + "B"
msg = getmsg(f)
assert msg is not None
line = msg.splitlines()[0]
if request.config.getoption("verbose") > 1:
assert line == (
"assert '123456789012345678901234567890... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 245 | getmsg | ref | function | msg = getmsg(f)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 248 | getoption | ref | function | if request.config.getoption("verbose") > 1:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 259 | test_dont_rewrite_if_hasattr_fails | def | function | def test_dont_rewrite_if_hasattr_fails(self, request) -> None:
class Y:
"""A class whose getattr fails, but not with `AttributeError`."""
def __getattr__(self, attribute_name):
raise KeyError()
def __repr__(self) -> str:
return "Y"
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 260 | Y | def | class | __getattr__ __repr__ __init__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 272 | f | def | function | def f() -> None:
assert "1234567890" * 5 + "A" == "1234567890" * 5 + "B"
msg = getmsg(f)
assert msg is not None
line = msg.splitlines()[0]
if request.config.getoption("verbose") > 1:
assert line == (
"assert '123456789012345678901234567890... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 273 | cls | ref | function | assert cls().foo == 2 # type: ignore[name-defined] # noqa: F821
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 276 | getmsg | ref | function | msg = getmsg(f, {"cls": Y})
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 279 | getoption | ref | function | if request.config.getoption("verbose") > 0:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 288 | test_assert_already_has_message | def | function | def test_assert_already_has_message(self) -> None:
def f():
assert _False, "something bad!"
assert getmsg(f) == "AssertionError: something bad!\nassert _False"
def test_assertion_message(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 289 | f | def | function | def f():
assert _False, "something bad!"
assert getmsg(f) == "AssertionError: something bad!\nassert _False"
def test_assertion_message(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def test_foo():
assert 1 == 2, "The failur... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 292 | getmsg | ref | function | assert getmsg(f) == "AssertionError: something bad!\nassert False"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 294 | test_assertion_message | def | function | def test_assertion_message(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def test_foo():
assert 1 == 2, "The failure message"
"""
)
result = pytester.runpytest()
assert result.ret == 1
result.stdout.fnmatch_lines(
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 295 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 301 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 303 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 307 | test_assertion_message_multiline | def | function | def test_assertion_message_multiline(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def test_foo():
assert 1 == 2, "A multiline\\nfailure message"
"""
)
result = pytester.runpytest()
assert result.ret == 1
result.st... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 308 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 314 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 316 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 320 | test_assertion_message_tuple | def | function | def test_assertion_message_tuple(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def test_foo():
assert 1 == 2, (1, 2)
"""
)
result = pytester.runpytest()
assert result.ret == 1
result.stdout.fnmatch_lines(
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 321 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 327 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 329 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 333 | test_assertion_message_expr | def | function | def test_assertion_message_expr(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def test_foo():
assert 1 == 2, 1 + 2
"""
)
result = pytester.runpytest()
assert result.ret == 1
result.stdout.fnmatch_lines(["*Assertion... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 334 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 340 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 342 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*AssertionError*3*", "*assert 1 == 2*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 344 | test_assertion_message_escape | def | function | def test_assertion_message_escape(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
def test_foo():
assert 1 == 2, 'To be escaped: %'
"""
)
result = pytester.runpytest()
assert result.ret == 1
result.stdout.fnmatch_lin... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 345 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 351 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 353 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 357 | test_assertion_messages_bytes | def | function | def test_assertion_messages_bytes(self, pytester: Pytester) -> None:
pytester.makepyfile("def test_bytes_assertion():\n assert _False, b'ohai!'\n")
result = pytester.runpytest()
assert result.ret == 1
result.stdout.fnmatch_lines(["*AssertionError: b'ohai!'", "*assert _False"])
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 358 | makepyfile | ref | function | pytester.makepyfile("def test_bytes_assertion():\n assert False, b'ohai!'\n")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py | testing/test_assertrewrite.py | 359 | runpytest | ref | function | result = pytester.runpytest()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.