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_assertrewrite.py
testing/test_assertrewrite.py
1,374
spy_find_spec
def
function
def spy_find_spec(name, path): self.find_spec_calls.append(name) return importlib.machinery.PathFinder.find_spec(name, path) hook = AssertionRewritingHook(pytestconfig) # use default patterns, otherwise we inherit pytest's testing config hook.fnpats[:] = ["test_*...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,376
find_spec
ref
function
return importlib.machinery.PathFinder.find_spec(name, path)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,378
AssertionRewritingHook
ref
function
hook = AssertionRewritingHook(pytestconfig)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,382
set_session
ref
function
hook.set_session(StubSession()) # type: ignore[arg-type]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,382
StubSession
ref
function
hook.set_session(StubSession()) # type: ignore[arg-type]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,383
syspathinsert
ref
function
pytester.syspathinsert()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,386
test_basic
def
function
def test_basic(self, pytester: Pytester, hook: AssertionRewritingHook) -> None: """ Ensure we avoid calling PathFinder.find_spec when we know for sure a certain module will not be rewritten to optimize assertion rewriting (#3918). """ pytester.makeconftest( """ ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,391
makeconftest
ref
function
pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,398
makepyfile
ref
function
pytester.makepyfile(test_foo="def test_foo(): pass")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,399
makepyfile
ref
function
pytester.makepyfile(bar="def bar(): pass")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,400
makepyfile
ref
function
foobar_path = pytester.makepyfile(foobar="def foobar(): pass")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,404
find_spec
ref
function
assert hook.find_spec("conftest") is not None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,408
find_spec
ref
function
assert hook.find_spec("test_foo") is not None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,412
find_spec
ref
function
assert hook.find_spec("bar") is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,416
find_spec
ref
function
assert hook.find_spec("foobar") is not None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,419
test_pattern_contains_subdirectories
def
function
def test_pattern_contains_subdirectories( self, pytester: Pytester, hook: AssertionRewritingHook ) -> None: """If one of the python_files patterns contain subdirectories ("tests/**.py") we can't bailout early because we need to match with the full path, which can only be found by calling...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,425
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,433
syspathinsert
ref
function
pytester.syspathinsert("tests")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,435
find_spec
ref
function
assert hook.find_spec("file") is not None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,438
skipif
ref
function
@pytest.mark.skipif(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,441
skipif
ref
function
@pytest.mark.skipif(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,444
test_cwd_changed
def
function
def test_cwd_changed(self, pytester: Pytester, monkeypatch) -> None: # Setup conditions for py's fspath trying to import pathlib on py34 # always (previously triggered via xdist only). # Ref: https://github.com/pytest-dev/py/pull/207 monkeypatch.syspath_prepend("") monkeypatc...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,448
syspath_prepend
ref
function
monkeypatch.syspath_prepend("")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,449
delitem
ref
function
monkeypatch.delitem(sys.modules, "pathlib", raising=False)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,451
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,466
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,467
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["* 1 passed in *"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,470
TestAssertionPass
def
class
test_option_default flag_on hook_on test_hook_call test_hook_call_with_parens test_hook_not_called_without_hookimpl test_hook_not_called_without_cmd_option
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,471
test_option_default
def
function
def test_option_default(self, pytester: Pytester) -> None: config = pytester.parseconfig() assert config.getini("enable_assertion_pass_hook") is _False @pytest.fixture def flag_on(self, pytester: Pytester): pytester.makeini("[pytest]\nenable_assertion_pass_hook = _True\n") @pyt...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,472
parseconfig
ref
function
config = pytester.parseconfig()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,473
getini
ref
function
assert config.getini("enable_assertion_pass_hook") is False
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,476
flag_on
def
function
def flag_on(self, pytester: Pytester): pytester.makeini("[pytest]\nenable_assertion_pass_hook = _True\n") @pytest.fixture def hook_on(self, pytester: Pytester): pytester.makeconftest( """\ def pytest_assertion_pass(item, lineno, orig, expl): raise Exc...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,477
makeini
ref
function
pytester.makeini("[pytest]\nenable_assertion_pass_hook = True\n")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,480
hook_on
def
function
def hook_on(self, pytester: Pytester): pytester.makeconftest( """\ def pytest_assertion_pass(item, lineno, orig, expl): raise Exception("Assertion Passed: {} {} at line {}".format(orig, expl, lineno)) """ ) def test_hook_call(self, pytester: P...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,481
makeconftest
ref
function
pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,488
test_hook_call
def
function
def test_hook_call(self, pytester: Pytester, flag_on, hook_on) -> None: pytester.makepyfile( """\ def test_simple(): a=1 b=2 c=3 d=0 assert a+b == c+d # cover failing assertions with a messa...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,489
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,504
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,505
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,509
test_hook_call_with_parens
def
function
def test_hook_call_with_parens(self, pytester: Pytester, flag_on, hook_on) -> None: pytester.makepyfile( """\ def f(): return 1 def test(): assert f() """ ) result = pytester.runpytest() result.stdout.fnmatch_lines("*Ass...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,510
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,517
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,518
fnmatch_lines
ref
function
result.stdout.fnmatch_lines("*Assertion Passed: f() 1")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,520
test_hook_not_called_without_hookimpl
def
function
def test_hook_not_called_without_hookimpl( self, pytester: Pytester, monkeypatch, flag_on ) -> None: """Assertion pass should not be called (and hence formatting should not occur) if there is no hook declared for pytest_assertion_pass""" def raise_on_assertionpass(*_, **__): ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,526
raise_on_assertionpass
def
function
def raise_on_assertionpass(*_, **__): raise Exception("Assertion passed called when it shouldn't!") monkeypatch.setattr( _pytest.assertion.rewrite, "_call_assertion_pass", raise_on_assertionpass ) pytester.makepyfile( """\ def test_simple...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,533
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,544
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,545
assert_outcomes
ref
function
result.assert_outcomes(passed=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,547
test_hook_not_called_without_cmd_option
def
function
def test_hook_not_called_without_cmd_option( self, pytester: Pytester, monkeypatch ) -> None: """Assertion pass should not be called (and hence formatting should not occur) if there is no hook declared for pytest_assertion_pass""" def raise_on_assertionpass(*_, **__): ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,553
raise_on_assertionpass
def
function
def raise_on_assertionpass(*_, **__): raise Exception("Assertion passed called when it shouldn't!") monkeypatch.setattr( _pytest.assertion.rewrite, "_call_assertion_pass", raise_on_assertionpass ) pytester.makepyfile( """\ def test_simple...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,560
makeconftest
ref
function
pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,567
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,578
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,579
assert_outcomes
ref
function
result.assert_outcomes(passed=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,582
parametrize
ref
function
@pytest.mark.parametrize(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,586
param
ref
function
pytest.param(b"", {}, id="trivial"),
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,587
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,592
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,599
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,606
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,612
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,620
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,628
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,635
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,641
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,649
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,657
param
ref
function
pytest.param(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,665
test_get_assertion_exprs
def
function
def test_get_assertion_exprs(src, expected) -> None: assert _get_assertion_exprs(src) == expected
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,666
_get_assertion_exprs
ref
function
assert _get_assertion_exprs(src) == expected
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,669
test_try_makedirs
def
function
def test_try_makedirs(monkeypatch, tmp_path: Path) -> None: from _pytest.assertion.rewrite import try_makedirs p = tmp_path / "foo" # create assert try_makedirs(p) assert p.is_dir() # already exist assert try_makedirs(p) # monkeypatch to simulate all error situations def fake_mkd...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,675
try_makedirs
ref
function
assert try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,679
try_makedirs
ref
function
assert try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,682
fake_mkdir
def
function
null
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,687
try_makedirs
ref
function
assert not try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,690
try_makedirs
ref
function
assert not try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,693
try_makedirs
ref
function
assert not try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,698
try_makedirs
ref
function
assert not try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,704
raises
ref
function
with pytest.raises(OSError) as exc_info:
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,705
try_makedirs
ref
function
try_makedirs(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,709
TestPyCacheDir
def
class
test_get_cache_dir test_sys_pycache_prefix_integration
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,710
parametrize
ref
function
@pytest.mark.parametrize(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,719
test_get_cache_dir
def
function
def test_get_cache_dir(self, monkeypatch, prefix, source, expected) -> None: monkeypatch.delenv("PYTHONPYCACHEPREFIX", raising=_False) if prefix is not None and sys.version_info < (3, 8): pytest.skip("pycache_prefix not available in py<38") monkeypatch.setattr(sys, "pycache_pref...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,720
delenv
ref
function
monkeypatch.delenv("PYTHONPYCACHEPREFIX", raising=False)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,723
skip
ref
function
pytest.skip("pycache_prefix not available in py<38")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,726
get_cache_dir
ref
function
assert get_cache_dir(Path(source)) == Path(expected)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,728
skipif
ref
function
@pytest.mark.skipif(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,731
skipif
ref
function
@pytest.mark.skipif(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,735
test_sys_pycache_prefix_integration
def
function
def test_sys_pycache_prefix_integration( self, tmp_path, monkeypatch, pytester: Pytester ) -> None: """Integration test for sys.pycache_prefix (#4730).""" pycache_prefix = tmp_path / "my/pycs" monkeypatch.setattr(sys, "pycache_prefix", str(pycache_prefix)) monkeypatch.set...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,743
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,753
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,762
get_cache_dir
ref
function
test_foo_pyc = get_cache_dir(test_foo) / ("test_foo" + PYC_TAIL)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,766
get_cache_dir
ref
function
bar_init_pyc = get_cache_dir(bar_init) / "__init__.{cache_tag}.pyc".format(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,772
TestReprSizeVerbosity
def
class
test_get_maxsize_for_saferepr create_test_file test_default_verbosity test_increased_verbosity test_max_increased_verbosity
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,778
parametrize
ref
function
@pytest.mark.parametrize(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,787
test_get_maxsize_for_saferepr
def
function
def test_get_maxsize_for_saferepr(self, verbose: int, expected_size) -> None: class FakeConfig: def getoption(self, name: str) -> int: assert name == "verbose" return verbose config = FakeConfig() assert _get_maxsize_for_saferepr(cast(Config, conf...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,788
FakeConfig
def
class
getoption
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,789
getoption
def
function
def getoption(self, name: str) -> int: assert name == "verbose" return verbose config = FakeConfig() assert _get_maxsize_for_saferepr(cast(Config, config)) == expected_size def create_test_file(self, pytester: Pytester, size: int) -> None: pytest...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,793
FakeConfig
ref
function
config = FakeConfig()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,794
_get_maxsize_for_saferepr
ref
function
assert _get_maxsize_for_saferepr(cast(Config, config)) == expected_size
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,796
create_test_file
def
function
def create_test_file(self, pytester: Pytester, size: int) -> None: pytester.makepyfile( f""" def test_very_long_string(): text = "x" * {size} assert "hello world" in text """ ) def test_default_verbosity(self, pytester: Pyteste...