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/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
317
pytest_collectreport
def
function
def pytest_collectreport(self, report: CollectReport) -> None: passed = report.outcome in ("passed", "skipped") if passed: if report.nodeid in self.lastfailed: self.lastfailed.pop(report.nodeid) self.lastfailed.update((item.nodeid, _True) for item in repor...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
326
hookimpl
ref
function
@hookimpl(hookwrapper=True, tryfirst=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
327
pytest_collection_modifyitems
def
function
def pytest_collection_modifyitems( self, config: Config, items: List[nodes.Item] ) -> Generator[None, None, None]: yield if not self.active: return if self.lastfailed: previously_failed = [] previously_passed = [] for item in item...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
352
getoption
ref
function
if self.config.getoption("lf"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
354
pytest_deselected
ref
function
config.hook.pytest_deselected(items=previously_passed)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
359
getoption
ref
function
suffix = " first" if self.config.getoption("failedfirst") else ""
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
371
getoption
ref
function
if self.config.getoption("last_failed_no_failures") == "none":
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
373
pytest_deselected
ref
function
config.hook.pytest_deselected(items=items[:])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
378
pytest_sessionfinish
def
function
def pytest_sessionfinish(self, session: Session) -> None: config = self.config if config.getoption("cacheshow") or hasattr(config, "workerinput"): return assert config.cache is not None saved_lastfailed = config.cache.get("cache/lastfailed", {}) if saved_lastfail...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
380
getoption
ref
function
if config.getoption("cacheshow") or hasattr(config, "workerinput"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
389
NFPlugin
def
class
__init__ pytest_collection_modifyitems _get_increasing_order pytest_sessionfinish
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
398
hookimpl
ref
function
@hookimpl(hookwrapper=True, tryfirst=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
399
pytest_collection_modifyitems
def
function
def pytest_collection_modifyitems( self, config: Config, items: List[nodes.Item] ) -> Generator[None, None, None]: yield if not self.active: return if self.lastfailed: previously_failed = [] previously_passed = [] for item in item...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
413
_get_increasing_order
ref
function
items[:] = self._get_increasing_order(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
415
_get_increasing_order
ref
function
) + self._get_increasing_order(other_items.values())
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
420
_get_increasing_order
def
function
def _get_increasing_order(self, items: Iterable[nodes.Item]) -> List[nodes.Item]: return sorted(items, key=lambda item: item.path.stat().st_mtime, reverse=_True) # type: ignore[no-any-return] def pytest_sessionfinish(self) -> None: config = self.config if config.getoption("cacheshow") ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
423
pytest_sessionfinish
def
function
def pytest_sessionfinish(self) -> None: config = self.config if config.getoption("cacheshow") or hasattr(config, "workerinput"): return if config.getoption("collectonly"): return assert config.cache is not None config.cache.set("cache/nodeids", sorte...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
425
getoption
ref
function
if config.getoption("cacheshow") or hasattr(config, "workerinput"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
428
getoption
ref
function
if config.getoption("collectonly"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
435
pytest_addoption
def
function
def pytest_addoption(parser: Parser) -> None: group = parser.getgroup("general") group.addoption( "--lf", "--last-failed", action="store_true", dest="lf", help="rerun only the tests that failed " "at the last run (or all if none failed)", ) group.addoption...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
436
getgroup
ref
function
group = parser.getgroup("general")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
437
addoption
ref
function
group.addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
445
addoption
ref
function
group.addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
454
addoption
ref
function
group.addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
462
addoption
ref
function
group.addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
472
addoption
ref
function
group.addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
481
addini
ref
function
parser.addini("cache_dir", default=cache_dir_default, help="cache directory path.")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
482
addoption
ref
function
group.addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
493
pytest_cmdline_main
def
function
def pytest_cmdline_main(config: Config) -> Optional[Union[int, ExitCode]]: if config.option.cacheshow: from _pytest.main import wrap_session return wrap_session(config, cacheshow) return None
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
497
wrap_session
ref
function
return wrap_session(config, cacheshow)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
501
hookimpl
ref
function
@hookimpl(tryfirst=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
502
pytest_configure
def
function
def pytest_configure(config: Config) -> None: config.cache = Cache.for_config(config, _ispytest=_True) config.pluginmanager.register(LFPlugin(config), "lfplugin") config.pluginmanager.register(NFPlugin(config), "nfplugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
503
for_config
ref
function
config.cache = Cache.for_config(config, _ispytest=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
504
register
ref
function
config.pluginmanager.register(LFPlugin(config), "lfplugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
504
LFPlugin
ref
function
config.pluginmanager.register(LFPlugin(config), "lfplugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
505
register
ref
function
config.pluginmanager.register(NFPlugin(config), "nfplugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
505
NFPlugin
ref
function
config.pluginmanager.register(NFPlugin(config), "nfplugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
509
cache
def
function
def cache(request: FixtureRequest) -> Cache: """Return a cache object that can persist state between testing sessions. cache.get(key, default) cache.set(key, value) Keys must be ``/`` separated strings, where the first part is usually the name of your plugin or application to avoid clashes with ot...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
524
pytest_report_header
def
function
def pytest_report_header(config: Config) -> Optional[str]: """Display cachedir with --cache-show and if non-default.""" if config.option.verbose > 0 or config.getini("cache_dir") != ".pytest_cache": assert config.cache is not None cachedir = config.cache._cachedir # TODO: evaluate genera...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
526
getini
ref
function
if config.option.verbose > 0 or config.getini("cache_dir") != ".pytest_cache":
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
540
cacheshow
def
function
def cacheshow(config: Config, session: Session) -> int: from pprint import pformat assert config.cache is not None tw = TerminalWriter() tw.line("cachedir: " + str(config.cache._cachedir)) if not config.cache._cachedir.is_dir(): tw.line("cache is empty") return 0 glob = config...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
545
TerminalWriter
ref
function
tw = TerminalWriter()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
546
line
ref
function
tw.line("cachedir: " + str(config.cache._cachedir))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
548
line
ref
function
tw.line("cache is empty")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
558
sep
ref
function
tw.sep("-", "cache values for %r" % glob)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
563
line
ref
function
tw.line("%s contains unreadable content, will be ignored" % key)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
565
line
ref
function
tw.line("%s contains:" % key)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
567
line
ref
function
tw.line(" " + line)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
572
sep
ref
function
tw.sep("-", "cache directories for %r" % glob)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/cacheprovider.py
src/_pytest/cacheprovider.py
578
line
ref
function
tw.line(f"{key} is a file of length {p.stat().st_size:d}")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
36
pytest_addoption
def
function
def pytest_addoption(parser: Parser) -> None: group = parser.getgroup("general") group._addoption( "--capture", action="store", default="fd", metavar="method", choices=["fd", "sys", "no", "tee-sys"], help="per-test capturing method: one of fd|sys|no|tee-sys.", ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
37
getgroup
ref
function
group = parser.getgroup("general")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
38
_addoption
ref
function
group._addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
46
_addoption
ref
function
group._addoption(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
55
_colorama_workaround
def
function
def _colorama_workaround() -> None: """Ensure colorama is imported so that it attaches to the correct stdio handles on Windows. colorama uses the terminal on import time. So if something does the first import of colorama while I/O capture is active, colorama will fail in various ways. """ i...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
70
_readline_workaround
def
function
def _readline_workaround() -> None: """Ensure readline is imported so that it attaches to the correct stdio handles on Windows. Pdb uses readline support where available--when not running from the Python prompt, the readline module is not imported until running the pdb REPL. If running pytest with...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
94
_py36_windowsconsoleio_workaround
def
function
def _py36_windowsconsoleio_workaround(stream: TextIO) -> None: """Workaround for Windows Unicode console handling on Python>=3.6. Python 3.6 implemented Unicode console handling for Windows. This works by reading/writing to the raw console handle using ``{Read,Write}ConsoleW``. The problem is that...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
131
_reopen_stdio
def
function
def _reopen_stdio(f, mode): if not buffered and mode[0] == "w": buffering = 0 else: buffering = -1 return io.TextIOWrapper( open(os.dup(f.fileno()), mode, buffering), # type: ignore[arg-type] f.encoding, f.errors, f.ne...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
145
_reopen_stdio
ref
function
sys.stdin = _reopen_stdio(sys.stdin, "rb")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
146
_reopen_stdio
ref
function
sys.stdout = _reopen_stdio(sys.stdout, "wb")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
147
_reopen_stdio
ref
function
sys.stderr = _reopen_stdio(sys.stderr, "wb")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
150
hookimpl
ref
function
@hookimpl(hookwrapper=True)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
151
pytest_load_initial_conftests
def
function
def pytest_load_initial_conftests(early_config: Config): ns = early_config.known_args_namespace if ns.capture == "fd": _py36_windowsconsoleio_workaround(sys.stdout) _colorama_workaround() _readline_workaround() pluginmanager = early_config.pluginmanager capman = CaptureManager(ns.capture...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
154
_py36_windowsconsoleio_workaround
ref
function
_py36_windowsconsoleio_workaround(sys.stdout)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
155
_colorama_workaround
ref
function
_colorama_workaround()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
156
_readline_workaround
ref
function
_readline_workaround()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
158
CaptureManager
ref
function
capman = CaptureManager(ns.capture)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
159
register
ref
function
pluginmanager.register(capman, "capturemanager")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
162
add_cleanup
ref
function
early_config.add_cleanup(capman.stop_global_capturing)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
165
start_global_capturing
ref
function
capman.start_global_capturing()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
167
suspend_global_capture
ref
function
capman.suspend_global_capture()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
169
read_global_capture
ref
function
out, err = capman.read_global_capture()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
177
EncodedFile
def
class
name mode
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
181
name
def
function
def name(self) -> str: # Ensure that file.name is a string. Workaround for a Python bug # fixed in >=3.7.4: https://bugs.python.org/issue36015 return repr(self.buffer) @property def mode(self) -> str: # TextIOWrapper doesn't expose a mode, but at least some of our # ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
187
mode
def
function
def mode(self) -> str: # TextIOWrapper doesn't expose a mode, but at least some of our # tests check it. return self.buffer.mode.replace("b", "")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
193
CaptureIO
def
class
__init__ getvalue
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
197
getvalue
def
function
def getvalue(self) -> str: assert isinstance(self.buffer, io.BytesIO) return self.buffer.getvalue().decode("UTF-8")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
199
getvalue
ref
function
return self.buffer.getvalue().decode("UTF-8")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
199
decode
ref
function
return self.buffer.getvalue().decode("UTF-8")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
202
TeeCaptureIO
def
class
__init__ write
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
212
DontReadFromInput
def
class
read __iter__ fileno isatty close buffer
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
237
buffer
def
function
def buffer(self): return self
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
247
NoCapture
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
252
SysCaptureBinary
def
class
__init__ repr __repr__ _assert_state start snap done suspend resume writeorg
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
262
DontReadFromInput
ref
function
tmpfile = DontReadFromInput()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
264
CaptureIO
ref
function
tmpfile = CaptureIO() if not tee else TeeCaptureIO(self._old)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
264
TeeCaptureIO
ref
function
tmpfile = CaptureIO() if not tee else TeeCaptureIO(self._old)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
286
_assert_state
def
function
def _assert_state(self, op: str, states: Tuple[str, ...]) -> None: assert ( self._state in states ), "cannot {} in state {!r}: expected one of {}".format( op, self._state, ", ".join(states) ) def start(self) -> None: self._assert_state("start", ("initiali...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
293
start
def
function
def start(self) -> None: self._assert_state("start", ("initialized",)) setattr(sys, self.name, self.tmpfile) self._state = "started" def snap(self): self._assert_state("snap", ("started", "suspended")) self.tmpfile.seek(0) res = self.tmpfile.buffer.read() ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
294
_assert_state
ref
function
self._assert_state("start", ("initialized",))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
298
snap
def
function
def snap(self): self._assert_state("snap", ("started", "suspended")) self.tmpfile.seek(0) res = self.tmpfile.buffer.read() self.tmpfile.seek(0) self.tmpfile.truncate() return res def done(self) -> None: self._assert_state("done", ("initialized", "started"...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
299
_assert_state
ref
function
self._assert_state("snap", ("started", "suspended"))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
306
done
def
function
def done(self) -> None: self._assert_state("done", ("initialized", "started", "suspended", "done")) if self._state == "done": return setattr(sys, self.name, self._old) del self._old self.tmpfile.close() self._state = "done" def suspend(self) -> None: ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
307
_assert_state
ref
function
self._assert_state("done", ("initialized", "started", "suspended", "done"))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
315
suspend
def
function
def suspend(self) -> None: self._assert_state("suspend", ("started", "suspended")) setattr(sys, self.name, self._old) self._state = "suspended" def resume(self) -> None: self._assert_state("resume", ("started", "suspended")) if self._state == "started": retur...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
316
_assert_state
ref
function
self._assert_state("suspend", ("started", "suspended"))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
320
resume
def
function
def resume(self) -> None: self._assert_state("resume", ("started", "suspended")) if self._state == "started": return setattr(sys, self.name, self.tmpfile) self._state = "started" def writeorg(self, data) -> None: self._assert_state("writeorg", ("started", "su...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
321
_assert_state
ref
function
self._assert_state("resume", ("started", "suspended"))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
327
writeorg
def
function
def writeorg(self, data) -> None: self._assert_state("writeorg", ("started", "suspended")) self._old.flush() self._old.buffer.write(data) self._old.buffer.flush()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/capture.py
src/_pytest/capture.py
328
_assert_state
ref
function
self._assert_state("writeorg", ("started", "suspended"))