tools/disable_tests/conditions.py
def merge(existing_cond: Condition, new_cond: Condition) -> Condition:
  """Merge two conditions together.

  Given an existing condition, parsed from a file, and a new condition to be
  added, combine the two to produce a merged condition.
  """

  # If currently ALWAYS, merging would only ever produce ALWAYS too. In this
  # case the user likely want to change the conditions or re-enable.
  if existing_cond == ALWAYS:
    return new_cond

  # If currently NEVER, ignore the current value - NEVER or X = X
  if existing_cond == NEVER:
    return new_cond

  # If new cond is ALWAYS, ignore the current value - X or ALWAYS = ALWAYS
  if new_cond == ALWAYS:
    return ALWAYS

  # Similar to the first branch, if the user has specified NEVER then ignore the
  # current value, as they're re-enabling it.
  if new_cond == NEVER:
    return NEVER

  # Otherwise, take the union of the two conditions
  cond = ('or', [existing_cond, new_cond])
  return simplify(cond)
Merge two conditions together.

  Given an existing condition, parsed from a file, and a new condition to be
  added, combine the two to produce a merged condition.
  
Merge two conditions together.
Given an existing condition, parsed from a file, and a new condition to be
added, combine the two to produce a merged condition.
Merge two conditions together . Given an existing condition parsed from a file and a new condition to be added combine the two to produce a merged condition .
def merge(existing_cond: Condition, new_cond: Condition) -> Condition:
  if existing_cond == ALWAYS:
    return new_cond
  if existing_cond == NEVER:
    return new_cond
  if new_cond == ALWAYS:
    return ALWAYS
  if new_cond == NEVER:
    return NEVER
  cond = ('or', [existing_cond, new_cond])
  return simplify(cond)
def merge ( existing_cond : Condition , new_cond : Condition ) -> Condition : if existing_cond == ALWAYS : return new_cond if existing_cond == NEVER : return new_cond if new_cond == ALWAYS : return ALWAYS if new_cond == NEVER : return NEVER cond = ( 'or' , [ existing_cond , new_cond ] ) return simplify ( cond )
Merge two conditions together.
Merge two conditions together .
"""Merge two conditions together.

  Given an existing condition, parsed from a file, and a new condition to be
  added, combine the two to produce a merged condition.
  """ # If currently ALWAYS, merging would only ever produce ALWAYS too. In this # case the user likely want to change the conditions or re-enable. # If currently NEVER, ignore the current value - NEVER or X = X # If new cond is ALWAYS, ignore the current value - X or ALWAYS = ALWAYS # Similar to the first branch, if the user has specified NEVER then ignore the # current value, as they're re-enabling it. # Otherwise, take the union of the two conditions
existing_cond
Condition
new_cond
Condition