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.
-
class
schrodinger.test.ioredirect.
IOCapture
[source]¶ Bases:
schrodinger.test.ioredirect.IORedirect
Use to redirect stderr & stdout to a StringIO object.
-
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.
-
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.