Package schrodinger :: Package test :: Package stu :: Module workup
[hide private]
[frames] | no frames]

Module workup

Runs workups.

Requires as input a testscript.TestScript object referring to a completed job. Uses the outcome status of the TestScript object as well as the workup protocol stored within the TestScript object to perform a workup and get a Pass/Fail (True/False) result for the test.

Actual workup criteria are in outcomes.


Copyright: Schrodinger, Inc. All rights reserved.

Functions [hide private]
 
in_dir(path)
Context Manager to allow safely changing directory
boolean
workup_outcome(test, job_dir)
Runs the outcome_workup of a given script.
 
check_exit_status(test)
Check that the exit status of the test matched expected.
 
check_workup(test, test_id)
Runs the listed workups for a test.
callable
get_workup_method(method_name)
Gets the workup method based on a string specification.
 
run_comparison(single_test, test_id)
Runs the comparison method described by single_test
 
print_summary(scripts)
Prints the summary information at end of a execution.
Variables [hide private]
  logger = log.get_logger('test_backend')
Function Details [hide private]

in_dir(path)

 

Context Manager to allow safely changing directory

Decorators:
  • @contextlib.contextmanager

workup_outcome(test, job_dir)

 

Runs the outcome_workup of a given script.

Parameters:
  • test (testscripts.TestScript) - The script to be tested.
  • job_dir (str) - The directory in which the job was executed
Returns: boolean
Does the test pass or fail?

check_exit_status(test)

 

Check that the exit status of the test matched expected. Either a good exit status or a bad one can be expected, you can't enforce that an exit status be "incorporated", for instance.

get_workup_method(method_name)

 

Gets the workup method based on a string specification. "Standard" workups should be specified like "workupfunctionname", and are in schrodinger.test.stu.outcomes. Custom workups are specified like "custom.modulename.workupfunctionname", and should be in schrodinger.test.stu.outcomes.custom, or subdirectories thereof.

Parameters:
  • method_name - Name of the workup.
Returns: callable
Function to determine if a test passed.

run_comparison(single_test, test_id)

 

Runs the comparison method described by single_test

Parameters:
  • single_test (list with two elements) - Description of workup methods
  • test_id (str) - The test_id or name

print_summary(scripts)

 

Prints the summary information at end of a execution.

Parameters:
  • scripts (dict) - a dictionary of TestScript objects. Each holds its own results information.
Returns:
Did all tests pass?