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/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
881
test_unicode_and_str_mixture
def
function
def test_unicode_and_str_mixture(self) -> None: f = capture.CaptureIO() f.write("\u00f6") pytest.raises(TypeError, f.write, b"hello") def test_write_bytes_to_buffer(self) -> None: """In python3, stdout / stderr are text io wrappers (exposing a buffer property of the unde...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
883
TeeCaptureIO
ref
function
f = capture.TeeCaptureIO(sio)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
885
raises
ref
function
pytest.raises(TypeError, f.write, b"hello")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
888
test_dontreadfrominput
def
function
def test_dontreadfrominput() -> None: from _pytest.capture import DontReadFromInput f = DontReadFromInput() assert f.buffer is f assert not f.isatty() pytest.raises(OSError, f.read) pytest.raises(OSError, f.readlines) iter_f = iter(f) pytest.raises(OSError, next, iter_f) pytest.rais...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
891
DontReadFromInput
ref
function
f = DontReadFromInput()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
894
raises
ref
function
pytest.raises(OSError, f.read)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
895
raises
ref
function
pytest.raises(OSError, f.readlines)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
897
raises
ref
function
pytest.raises(OSError, next, iter_f)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
898
raises
ref
function
pytest.raises(UnsupportedOperation, f.fileno)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
902
test_captureresult
def
function
def test_captureresult() -> None: cr = CaptureResult("out", "err") assert len(cr) == 2 assert cr.out == "out" assert cr.err == "err" out, err = cr assert out == "out" assert err == "err" assert cr[0] == "out" assert cr[1] == "err" assert cr == cr assert cr == CaptureResult("o...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
903
CaptureResult
ref
function
cr = CaptureResult("out", "err")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
913
CaptureResult
ref
function
assert cr == CaptureResult("out", "err")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
914
CaptureResult
ref
function
assert cr != CaptureResult("wrong", "err")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
917
CaptureResult
ref
function
assert hash(cr) == hash(CaptureResult("out", "err"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
926
raises
ref
function
with pytest.raises(ValueError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
929
_replace
ref
function
assert cr._replace(err="replaced") == ("out", "replaced")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
933
tmpfile
def
function
def tmpfile(pytester: Pytester) -> Generator[BinaryIO, None, None]: f = pytester.makepyfile("").open("wb+") yield f if not f.closed: f.close()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
934
makepyfile
ref
function
f = pytester.makepyfile("").open("wb+")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
941
lsof_check
def
function
def lsof_check(): pid = os.getpid() try: out = subprocess.check_output(("lsof", "-p", str(pid))).decode() except (OSError, subprocess.CalledProcessError, UnicodeDecodeError) as exc: # about UnicodeDecodeError, see note on pytester pytest.skip(f"could not run 'lsof' ({exc!r})") yi...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
944
decode
ref
function
out = subprocess.check_output(("lsof", "-p", str(pid))).decode()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
947
skip
ref
function
pytest.skip(f"could not run 'lsof' ({exc!r})")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
949
decode
ref
function
out2 = subprocess.check_output(("lsof", "-p", str(pid))).decode()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
955
TestFDCapture
def
class
test_simple test_simple_many test_simple_many_check_open_files test_simple_fail_second_start test_stderr test_stdin test_writeorg test_simple_resume_suspend test_capfd_sys_stdout_mode
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
956
test_simple
def
function
def test_simple(self, tmpfile: BinaryIO) -> None: fd = tmpfile.fileno() cap = capture.FDCapture(fd) data = b"hello" os.write(fd, data) pytest.raises(AssertionError, cap.snap) cap.done() cap = capture.FDCapture(fd) cap.start() os.write(fd, data)...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
958
FDCapture
ref
function
cap = capture.FDCapture(fd)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
961
raises
ref
function
pytest.raises(AssertionError, cap.snap)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
962
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
963
FDCapture
ref
function
cap = capture.FDCapture(fd)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
964
start
ref
function
cap.start()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
966
snap
ref
function
s = cap.snap()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
967
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
970
test_simple_many
def
function
def test_simple_many(self, tmpfile: BinaryIO) -> None: for i in range(10): self.test_simple(tmpfile) def test_simple_many_check_open_files(self, pytester: Pytester) -> None: with lsof_check(): with pytester.makepyfile("").open("wb+") as tmpfile: self.test...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
972
test_simple
ref
function
self.test_simple(tmpfile)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
974
test_simple_many_check_open_files
def
function
def test_simple_many_check_open_files(self, pytester: Pytester) -> None: with lsof_check(): with pytester.makepyfile("").open("wb+") as tmpfile: self.test_simple_many(tmpfile) def test_simple_fail_second_start(self, tmpfile: BinaryIO) -> None: fd = tmpfile.fileno() ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
975
lsof_check
ref
function
with lsof_check():
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
976
makepyfile
ref
function
with pytester.makepyfile("").open("wb+") as tmpfile:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
977
test_simple_many
ref
function
self.test_simple_many(tmpfile)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
979
test_simple_fail_second_start
def
function
def test_simple_fail_second_start(self, tmpfile: BinaryIO) -> None: fd = tmpfile.fileno() cap = capture.FDCapture(fd) cap.done() pytest.raises(AssertionError, cap.start) def test_stderr(self) -> None: cap = capture.FDCapture(2) cap.start() print("hello", ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
981
FDCapture
ref
function
cap = capture.FDCapture(fd)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
982
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
983
raises
ref
function
pytest.raises(AssertionError, cap.start)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
985
test_stderr
def
function
def test_stderr(self) -> None: cap = capture.FDCapture(2) cap.start() print("hello", file=sys.stderr) s = cap.snap() cap.done() assert s == "hello\n" def test_stdin(self) -> None: cap = capture.FDCapture(0) cap.start() x = os.read(0, 100)....
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
986
FDCapture
ref
function
cap = capture.FDCapture(2)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
987
start
ref
function
cap.start()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
989
snap
ref
function
s = cap.snap()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
990
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
993
test_stdin
def
function
def test_stdin(self) -> None: cap = capture.FDCapture(0) cap.start() x = os.read(0, 100).strip() cap.done() assert x == b"" def test_writeorg(self, tmpfile: BinaryIO) -> None: data1, data2 = b"foo", b"bar" cap = capture.FDCapture(tmpfile.fileno()) ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
994
FDCapture
ref
function
cap = capture.FDCapture(0)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
995
start
ref
function
cap.start()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
997
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,000
test_writeorg
def
function
def test_writeorg(self, tmpfile: BinaryIO) -> None: data1, data2 = b"foo", b"bar" cap = capture.FDCapture(tmpfile.fileno()) cap.start() tmpfile.write(data1) tmpfile.flush() cap.writeorg(data2.decode("ascii")) scap = cap.snap() cap.done() assert...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,002
FDCapture
ref
function
cap = capture.FDCapture(tmpfile.fileno())
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,003
start
ref
function
cap.start()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,006
writeorg
ref
function
cap.writeorg(data2.decode("ascii"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,006
decode
ref
function
cap.writeorg(data2.decode("ascii"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,007
snap
ref
function
scap = cap.snap()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,008
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,009
decode
ref
function
assert scap == data1.decode("ascii")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,014
test_simple_resume_suspend
def
function
def test_simple_resume_suspend(self) -> None: with saved_fd(1): cap = capture.FDCapture(1) cap.start() data = b"hello" os.write(1, data) sys.stdout.write("whatever") s = cap.snap() assert s == "hellowhatever" cap...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,015
saved_fd
ref
function
with saved_fd(1):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,016
FDCapture
ref
function
cap = capture.FDCapture(1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,017
start
ref
function
cap.start()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,021
snap
ref
function
s = cap.snap()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,023
suspend
ref
function
cap.suspend()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,026
snap
ref
function
assert not cap.snap()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,027
resume
ref
function
cap.resume()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,030
snap
ref
function
s = cap.snap()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,032
suspend
ref
function
cap.suspend()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,033
done
ref
function
cap.done()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,034
raises
ref
function
pytest.raises(AssertionError, cap.suspend)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,048
test_capfd_sys_stdout_mode
def
function
def test_capfd_sys_stdout_mode(self, capfd) -> None: assert "b" not in sys.stdout.mode
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,053
saved_fd
def
function
def saved_fd(fd): new_fd = os.dup(fd) try: yield finally: os.dup2(new_fd, fd) os.close(new_fd)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,062
TestStdCapture
def
class
getcapture test_capturing_done_simple test_capturing_reset_simple test_capturing_readouterr test_capture_results_accessible_by_attribute test_capturing_readouterr_unicode test_reset_twice_error test_capturing_modify_sysouterr_in_between test_capturing_error_recursive test_just_out_capture test_just_err_capture test_std...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,066
getcapture
def
function
def getcapture(self, **kw): cap = self.__class__.captureclass(**kw) cap.start_capturing() try: yield cap finally: cap.stop_capturing() def test_capturing_done_simple(self) -> None: with self.getcapture() as cap: sys.stdout.write("hello...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,067
captureclass
ref
class
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,068
start_capturing
ref
function
cap.start_capturing()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,072
stop_capturing
ref
function
cap.stop_capturing()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,074
test_capturing_done_simple
def
function
def test_capturing_done_simple(self) -> None: with self.getcapture() as cap: sys.stdout.write("hello") sys.stderr.write("world") out, err = cap.readouterr() assert out == "hello" assert err == "world" def test_capturing_reset_simple(self) -> None: ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,075
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,078
readouterr
ref
function
out, err = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,082
test_capturing_reset_simple
def
function
def test_capturing_reset_simple(self) -> None: with self.getcapture() as cap: print("hello world") sys.stderr.write("hello error\n") out, err = cap.readouterr() assert out == "hello world\n" assert err == "hello error\n" def test_capturing_readouterr(...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,083
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,086
readouterr
ref
function
out, err = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,090
test_capturing_readouterr
def
function
def test_capturing_readouterr(self) -> None: with self.getcapture() as cap: print("hello world") sys.stderr.write("hello error\n") out, err = cap.readouterr() assert out == "hello world\n" assert err == "hello error\n" sys.stderr.write(...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,091
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,094
readouterr
ref
function
out, err = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,098
readouterr
ref
function
out, err = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,101
test_capture_results_accessible_by_attribute
def
function
def test_capture_results_accessible_by_attribute(self) -> None: with self.getcapture() as cap: sys.stdout.write("hello") sys.stderr.write("world") capture_result = cap.readouterr() assert capture_result.out == "hello" assert capture_result.err == "world" ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,102
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,105
readouterr
ref
function
capture_result = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,109
test_capturing_readouterr_unicode
def
function
def test_capturing_readouterr_unicode(self) -> None: with self.getcapture() as cap: print("hxąć") out, err = cap.readouterr() assert out == "hxąć\n" def test_reset_twice_error(self) -> None: with self.getcapture() as cap: print("hello") ou...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,110
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,112
readouterr
ref
function
out, err = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,115
test_reset_twice_error
def
function
def test_reset_twice_error(self) -> None: with self.getcapture() as cap: print("hello") out, err = cap.readouterr() pytest.raises(ValueError, cap.stop_capturing) assert out == "hello\n" assert not err def test_capturing_modify_sysouterr_in_between(self) -...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,116
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,118
readouterr
ref
function
out, err = cap.readouterr()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,119
raises
ref
function
pytest.raises(ValueError, cap.stop_capturing)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,123
test_capturing_modify_sysouterr_in_between
def
function
def test_capturing_modify_sysouterr_in_between(self) -> None: oldout = sys.stdout olderr = sys.stderr with self.getcapture() as cap: sys.stdout.write("hello") sys.stderr.write("world") sys.stdout = capture.CaptureIO() sys.stderr = capture.Captu...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,126
getcapture
ref
function
with self.getcapture() as cap:
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_capture.py
testing/test_capture.py
1,129
CaptureIO
ref
function
sys.stdout = capture.CaptureIO()