schrodinger.test.unittest_utils module

schrodinger.test.unittest_utils.change_booleaness(obj, truth_value)[source]

Sets the return value for __bool__ or __nonzero__ depending on whether or not you are in Python 2 or Python 3

Parameters
  • obj (objects) – An object that has the __bool__ or __nonzero__ attribute

  • truth_value (bool) – What __bool__ or __nonzero__ should return

schrodinger.test.unittest_utils.wait_until_condition_met(success_cond_func, poll_interval=500, timeout=300)[source]

Call success_cond_func until it returns True or the time runs out.

Parameters
  • success_cond_func (callable) – Function to call until it returns True

  • poll_interval (int) – How often to check for success (milliseconds)

  • timeout (int) – When to time out (seconds)

Returns

Whether the function timed out

Return type

bool