Skip to content

Commit

Permalink
Switch from unittest to testutils.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 301875411
Change-Id: Ie5df8560ce1a17f3cbf30b8087fb807398eb5ee0
  • Loading branch information
dbieber authored and Copybara-Service committed Mar 19, 2020
1 parent b978161 commit 61785e6
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions fire/helptext_test.py
Expand Up @@ -20,7 +20,6 @@

import os
import textwrap
import unittest

from fire import formatting
from fire import helptext
Expand Down Expand Up @@ -160,21 +159,19 @@ def testHelpTextNoInit(self):
self.assertIn('NAME\n OldStyleEmpty', help_screen)
self.assertIn('SYNOPSIS\n OldStyleEmpty', help_screen)

@unittest.skipIf(
six.PY2,
'Python 2 does not support single asterisk in function definition')
@testutils.skipIf(
six.PY2, 'Python 2 does not support keyword-only arguments.')
def testHelpTextKeywordOnlyArgumentsWithDefault(self):
component = tc.py3.KeywordOnly.with_default
component = tc.py3.KeywordOnly.with_default # pytype: disable=module-attr
output = helptext.HelpText(
component=component, trace=trace.FireTrace(component, 'with_default'))
self.assertIn('NAME\n with_default', output)
self.assertIn('FLAGS\n --x=X', output)

@unittest.skipIf(
six.PY2,
'Python 2 does not support single asterisk in function definition')
@testutils.skipIf(
six.PY2, 'Python 2 does not support keyword-only arguments.')
def testHelpTextKeywordOnlyArgumentsWithoutDefault(self):
component = tc.py3.KeywordOnly.double
component = tc.py3.KeywordOnly.double # pytype: disable=module-attr
output = helptext.HelpText(
component=component, trace=trace.FireTrace(component, 'double'))
self.assertIn('NAME\n double', output)
Expand Down

0 comments on commit 61785e6

Please sign in to comment.