schrodinger.test.ioredirect module

schrodinger.test.ioredirect.replace_output_logger_stream(stream)[source]

Replace the stream used by output loggers.

class schrodinger.test.ioredirect.IORedirect(stdout, stderr)[source]

Bases: object

Use to redirect stderr & stdout.

__init__(stdout, stderr)[source]
class schrodinger.test.ioredirect.IOCapture[source]

Bases: schrodinger.test.ioredirect.IORedirect

Use to redirect stderr & stdout to a StringIO object.

__init__()[source]
class schrodinger.test.ioredirect.IOSilence[source]

Bases: object

A context manager for doing a “deep suppression” of stdout and stderr, which will point the file descriptors to devnull.

Useful for cases where C/Fortran code does not use mmerr and there is an expected error message.

__init__()[source]
class schrodinger.test.ioredirect.FullIORedirect[source]

Bases: schrodinger.test.ioredirect.IOSilence

Context manager returns an IOString with all output from stderr/stdout.

Because of output from c / python, this output may not be in the correct order. This is indeed to be used to verify certain messages from errors, in tests only.

__init__()[source]