Skip to content

Commit

Permalink
Fix test skip.
Browse files Browse the repository at this point in the history
  • Loading branch information
ysiraichi committed Mar 1, 2024
1 parent d56b07e commit b6b64c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ def _is_on_eager_debug_mode():
'skip on eager debug mode')


def _skipIfFunctionalization(disabled=True, reason=""):
verb = "is" if disabled else "is not"
def _skipIfFunctionalization(value=True, reason=""):
verb = "is" if value else "is not"
reason = f" Reason: {reason}" if reason else ""
return unittest.skipIf(
XLA_DISABLE_FUNCTIONALIZATION,
XLA_DISABLE_FUNCTIONALIZATION is value,
f'Works only when functionalization {verb} disabled.{reason}.')


def skipIfFunctionalizationEnabled(reason):
return _skipIfFunctionalization(disabled=False, reason=reason)
return _skipIfFunctionalization(value=False, reason=reason)


def skipIfFunctionalizationDisabled(reason):
return _skipIfFunctionalization(disabled=True, reason=reason)
return _skipIfFunctionalization(value=True, reason=reason)


def _gen_tensor(*args, **kwargs):
Expand Down Expand Up @@ -994,7 +994,7 @@ def func(a, b):

# TODO - upstream behavior has changed and results in expected DestroyXlaTensor
# counter as of 11/13/2023. Re-enable after reviewing the change.
@skipIfFunctionalizationDisabled("metrics differ")
# @skipIfFunctionalizationDisabled("metrics differ")
def test_set(self):
met.clear_all()

Expand Down

0 comments on commit b6b64c7

Please sign in to comment.