def determine_status(self, proc, isalive=False, expectedfail=()): """
Use to determine if the situation has failed.
Parameters:
proc -- the processhandler instance
isalive -- Use True to indicate we passif the process exists; however, by default
the test will passif the process does not exist (isalive == False)
expectedfail -- Defaults to [], used to indicate a list of fields
that are expected to fail """
returncode = proc.proc.returncode
didtimeout = proc.didTimeout
detected = ProcessHandler.pid_exists(proc.pid)
output = "" # ProcessHandler has output when store_output is set to True in the constructor # (this is the default) if getattr(proc, "output"):
output = proc.output
if"didtimeout"in expectedfail:
self.assertTrue(didtimeout, "Detected that process didn't time out") else:
self.assertTrue(not didtimeout, "Detected that process timed out")
if isalive:
self.assertTrue(
detected, "Detected process is not running, ""process output: %s" % output,
) else:
self.assertTrue( not detected, "Detected process is still running, ""process output: %s" % output,
)
Messung V0.5
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.