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
980
makepyfile
ref
function
pytester.makepyfile(test_remember_rewritten_modules="")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
982
AssertionRewritingHook
ref
function
hook = AssertionRewritingHook(pytestconfig)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
986
find_spec
ref
function
spec = hook.find_spec("test_remember_rewritten_modules")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
988
module_from_spec
ref
function
module = importlib.util.module_from_spec(spec)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
989
exec_module
ref
function
hook.exec_module(module)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
990
mark_rewrite
ref
function
hook.mark_rewrite("test_remember_rewritten_modules")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
991
mark_rewrite
ref
function
hook.mark_rewrite("test_remember_rewritten_modules")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
994
test_rewrite_warning_using_pytest_plugins
def
function
def test_rewrite_warning_using_pytest_plugins(self, pytester: Pytester) -> None: pytester.makepyfile( **{ "conftest.py": "pytest_plugins = ['core', 'gui', 'sci']", "core.py": "", "gui.py": "pytest_plugins = ['core', 'sci']", "sci.py...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
995
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,005
runpytest_subprocess
ref
function
result = pytester.runpytest_subprocess()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,006
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,007
no_fnmatch_line
ref
function
result.stdout.no_fnmatch_line("*pytest-warning summary*")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,009
test_rewrite_warning_using_pytest_plugins_env_var
def
function
def test_rewrite_warning_using_pytest_plugins_env_var( self, pytester: Pytester, monkeypatch ) -> None: monkeypatch.setenv("PYTEST_PLUGINS", "plugin") pytester.makepyfile( **{ "plugin.py": "", "test_rewrite_warning_using_pytest_plugins_env_var....
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,012
setenv
ref
function
monkeypatch.setenv("PYTEST_PLUGINS", "plugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,013
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,025
runpytest_subprocess
ref
function
result = pytester.runpytest_subprocess()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,026
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,027
no_fnmatch_line
ref
function
result.stdout.no_fnmatch_line("*pytest-warning summary*")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,030
TestAssertionRewriteHookDetails
def
class
test_sys_meta_path_munged test_write_pyc test_resources_provider_for_loader test_read_pyc test_read_pyc_more_invalid test_reload_is_same_and_reloads test_get_data_support
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,031
test_sys_meta_path_munged
def
function
def test_sys_meta_path_munged(self, pytester: Pytester) -> None: pytester.makepyfile( """ def test_meta_path(): import sys; sys.meta_path = []""" ) assert pytester.runpytest().ret == 0 def test_write_pyc(self, pytester: Pytester, tmp_path, monkeyp...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,032
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,037
runpytest
ref
function
assert pytester.runpytest().ret == 0
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,039
test_write_pyc
def
function
def test_write_pyc(self, pytester: Pytester, tmp_path, monkeypatch) -> None: from _pytest.assertion.rewrite import _write_pyc from _pytest.assertion import AssertionState config = pytester.parseconfig() state = AssertionState(config, "rewrite") tmp_path.joinpath("source.py")...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,043
parseconfig
ref
function
config = pytester.parseconfig()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,044
AssertionState
ref
function
state = AssertionState(config, "rewrite")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,049
_write_pyc
ref
function
assert _write_pyc(state, co, os.stat(source_path), pycpath)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,055
atomic_write_failed
def
function
null
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,066
raise_oserror
def
function
def raise_oserror(*args): raise OSError() monkeypatch.setattr("os.rename", raise_oserror) assert not _write_pyc(state, co, os.stat(source_path), pycpath) def test_resources_provider_for_loader(self, pytester: Pytester) -> None: """ Attempts to load ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,071
_write_pyc
ref
function
assert not _write_pyc(state, co, os.stat(source_path), pycpath)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,073
test_resources_provider_for_loader
def
function
def test_resources_provider_for_loader(self, pytester: Pytester) -> None: """ Attempts to load resources from a package should succeed normally, even when the AssertionRewriteHook is used to load the modules. See #366 for details. """ pytest.importorskip("pkg_resourc...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,080
importorskip
ref
function
pytest.importorskip("pkg_resources")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,082
mkpydir
ref
function
pytester.mkpydir("testpkg")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,097
makepyfile
ref
function
pytester.makepyfile(**contents)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,098
maketxtfile
ref
function
pytester.maketxtfile(**{"testpkg/resource": "Load me please."})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,100
runpytest_subprocess
ref
function
result = pytester.runpytest_subprocess()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,101
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,103
test_read_pyc
def
function
def test_read_pyc(self, tmp_path: Path) -> None: """ Ensure that the `_read_pyc` can properly deal with corrupted pyc files. In those circumstances it should just give up instead of generating an exception that is propagated to the caller. """ import py_compile ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,123
_read_pyc
ref
function
assert _read_pyc(source, pyc) is None # no error
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,125
skipif
ref
function
@pytest.mark.skipif(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,128
test_read_pyc_more_invalid
def
function
def test_read_pyc_more_invalid(self, tmp_path: Path) -> None: from _pytest.assertion.rewrite import _read_pyc source = tmp_path / "source.py" pyc = tmp_path / "source.pyc" source_bytes = b"def test(): pass\n" source.write_bytes(source_bytes) magic = importlib.util....
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,142
from_bytes
ref
function
mtime_int = int.from_bytes(mtime, "little")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,145
to_bytes
ref
function
size = len(source_bytes).to_bytes(4, "little")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,151
_read_pyc
ref
function
assert _read_pyc(source, pyc, print) is not None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,155
_read_pyc
ref
function
assert _read_pyc(source, pyc, print) is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,159
_read_pyc
ref
function
assert _read_pyc(source, pyc, print) is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,163
_read_pyc
ref
function
assert _read_pyc(source, pyc, print) is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,167
_read_pyc
ref
function
assert _read_pyc(source, pyc, print) is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,171
_read_pyc
ref
function
assert _read_pyc(source, pyc, print) is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,173
test_reload_is_same_and_reloads
def
function
def test_reload_is_same_and_reloads(self, pytester: Pytester) -> None: """Reloading a (collected) module after change picks up the change.""" pytester.makeini( """ [pytest] python_files = *.py """ ) pytester.makepyfile( file...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,175
makeini
ref
function
pytester.makeini(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,181
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,202
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,203
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["* 1 passed*"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,205
test_get_data_support
def
function
def test_get_data_support(self, pytester: Pytester) -> None: """Implement optional PEP302 api (#808).""" path = pytester.mkpydir("foo") path.joinpath("test_foo.py").write_text( textwrap.dedent( """\ class Test(object): def test_...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,207
mkpydir
ref
function
path = pytester.mkpydir("foo")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,220
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,221
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*1 passed*"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,224
test_issue731
def
function
def test_issue731(pytester: Pytester) -> None: pytester.makepyfile( """ class LongReprWithBraces(object): def __repr__(self): return 'LongReprWithBraces({' + ('a' * 80) + '}' + ('a' * 120) + ')' def some_method(self): return _False def test_long_repr(): ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,225
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,239
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,240
no_fnmatch_line
ref
function
result.stdout.no_fnmatch_line("*unbalanced braces*")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,243
TestIssue925
def
class
test_simple_case test_long_case test_many_brackets
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,244
test_simple_case
def
function
def test_simple_case(self, pytester: Pytester) -> None: pytester.makepyfile( """ def test_ternary_display(): assert (_False == _False) == _False """ ) result = pytester.runpytest() result.stdout.fnmatch_lines(["*E*assert (_False == _False) == _...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,245
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,251
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,252
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*E*assert (False == False) == False"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,254
test_long_case
def
function
def test_long_case(self, pytester: Pytester) -> None: pytester.makepyfile( """ def test_ternary_display(): assert _False == (_False == _True) == _True """ ) result = pytester.runpytest() result.stdout.fnmatch_lines(["*E*assert (_False == _True...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,255
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,261
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,262
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*E*assert (False == True) == True"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,264
test_many_brackets
def
function
def test_many_brackets(self, pytester: Pytester) -> None: pytester.makepyfile( """ def test_ternary_display(): assert _True == ((_False == _True) == _True) """ ) result = pytester.runpytest() result.stdout.fnmatch_lines(["*E*assert...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,265
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,271
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,272
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*E*assert True == ((False == True) == True)"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,275
TestIssue2121
def
class
test_rewrite_python_files_contain_subdirs
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,276
test_rewrite_python_files_contain_subdirs
def
function
def test_rewrite_python_files_contain_subdirs(self, pytester: Pytester) -> None: pytester.makepyfile( **{ "tests/file.py": """ def test_simple_failure(): assert 1 + 1 == 3 """ } ) pytester.makeini( ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,277
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,285
makeini
ref
function
pytester.makeini(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,291
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,292
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*E*assert (1 + 1) == 3"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,295
skipif
ref
function
@pytest.mark.skipif(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,298
parametrize
ref
function
@pytest.mark.parametrize("offset", [-1, +1])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,299
test_source_mtime_long_long
def
function
def test_source_mtime_long_long(pytester: Pytester, offset) -> None: """Support modification dates after 2038 in rewritten files (#4903). pytest would crash with: fp.write(struct.pack("<ll", mtime, size)) E struct.error: argument out of range """ p = pytester.makepyfile( ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,307
makepyfile
ref
function
p = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,317
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,321
test_rewrite_infinite_recursion
def
function
def test_rewrite_infinite_recursion( pytester: Pytester, pytestconfig, monkeypatch
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,329
syspathinsert
ref
function
pytester.syspathinsert()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,330
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,331
makepyfile
ref
function
pytester.makepyfile(test_bar="def test_bar(): pass")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,337
spy_write_pyc
def
function
def spy_write_pyc(*args, **kwargs): # make a note that we have called _write_pyc write_pyc_called.append(_True) # try to import a module at this point: we should not try to rewrite this module assert hook.find_spec("test_bar") is None return original_write_pyc(*args, **kwargs...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,341
find_spec
ref
function
assert hook.find_spec("test_bar") is None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,342
original_write_pyc
ref
function
return original_write_pyc(*args, **kwargs)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,347
AssertionRewritingHook
ref
function
hook = AssertionRewritingHook(pytestconfig)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,348
find_spec
ref
function
spec = hook.find_spec("test_foo")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,350
module_from_spec
ref
function
module = importlib.util.module_from_spec(spec)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,351
exec_module
ref
function
hook.exec_module(module)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,355
TestEarlyRewriteBailout
def
class
hook test_basic test_pattern_contains_subdirectories test_cwd_changed
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,357
hook
def
function
def hook( self, pytestconfig, monkeypatch, pytester: Pytester ) -> AssertionRewritingHook: """Returns a patched AssertionRewritingHook instance so we can configure its initial paths and track if PathFinder.find_spec has been called. """ import importlib.machinery ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,368
StubSession
def
class
isinitpath
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_assertrewrite.py
testing/test_assertrewrite.py
1,371
isinitpath
def
function
def isinitpath(self, p): return p in self._initialpaths 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 pat...