module pycode.utils_tests_stringio

Inheritance diagram of pyquickhelper.pycode.utils_tests_stringio

Short summary

module pyquickhelper.pycode.utils_tests_stringio

A io.StringIO which also outputs its content for a file.

source on GitHub

Classes

class

truncated documentation

StringIOAndFile

Overloads a StringIO to also writes in a file.

Methods

method

truncated documentation

__init__

constructor

begin_test

Redirects output to a io.StringIO.

close

Calls two close.

end_test

Ends the redirection.

flush

Calls two flush.

getvalue

Returns the content of the buffer.

write

Appends a string.

Documentation

A io.StringIO which also outputs its content for a file.

source on GitHub

class pyquickhelper.pycode.utils_tests_stringio.StringIOAndFile(filename)[source][source]

Bases: _io.StringIO

Overloads a StringIO to also writes in a file.

source on GitHub

constructor

Parameters

filename – filename

source on GitHub

__init__(filename)[source][source]

constructor

Parameters

filename – filename

source on GitHub

begin_test(name)[source][source]

Redirects output to a io.StringIO.

Parameters

name – name

source on GitHub

close()[source][source]

Calls two close.

source on GitHub

end_test(name)[source][source]

Ends the redirection.

Parameters

name – name

source on GitHub

flush()[source][source]

Calls two flush.

source on GitHub

getvalue()[source][source]

Returns the content of the buffer.

source on GitHub

write(s)[source][source]

Appends a string.

Parameters

s – add a string to the stream

Returns

self

source on GitHub