10000 Switch from unittest to testutils. · randomprin/python-fire@61785e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 61785e6

Browse files
dbiebercopybara-github
authored andcommitted
Switch from unittest to testutils.
PiperOrigin-RevId: 301875411 Change-Id: Ie5df8560ce1a17f3cbf30b8087fb807398eb5ee0
1 parent b978161 commit 61785e6

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

fire/helptext_test.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import os
2222
import textwrap
23-
import unittest
2423

2524
from fire import formatting
2625
from fire import helptext
@@ -160,21 +159,19 @@ def testHelpTextNoInit(self):
160159
self.assertIn('NAME\n OldStyleEmpty', help_screen)
161160
self.assertIn('SYNOPSIS\n OldStyleEmpty', help_screen)
162161

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

173-
@unittest.skipIf(
174-
six.PY2,
175-
'Python 2 does not support single asterisk in function definition')
171+
@testutils.skipIf(
172+
six.PY2, 'Python 2 does not support keyword-only arguments.')
176173
def testHelpTextKeywordOnlyArgumentsWithoutDefault(self):
177-
component = tc.py3.KeywordOnly.double
174+
component = tc.py3.KeywordOnly.double # pytype: disable=module-attr
178175
output = helptext.HelpText(
179176
component=component, trace=trace.FireTrace(component, 'double'))
180177
self.assertIn('NAME\n double', output)

0 commit comments

Comments
 (0)
0