Skip to content

Commit 60ebd77

Browse files
committed
Some fitzing with imports and docstrings to make the linters happy.
Copybara generated commit for Python Fire. PiperOrigin-RevId: 150942368 Change-Id: I7ba73d5a9845d642f99ffeba6c953d8116830a33 Reviewed-on: https://team-review.git.corp.google.com/65058 Reviewed-by: David Bieber <dbieber@google.com>
1 parent 95de757 commit 60ebd77

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

fire/core_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
from __future__ import division
1717
from __future__ import print_function
1818

19-
import mock
20-
import unittest
21-
2219
from fire import core
2320
from fire import test_components as tc
2421
from fire import testutils
2522
from fire import trace
23+
import mock
24+
25+
import unittest
2626

2727

2828
class CoreTest(testutils.BaseTestCase):

fire/fire_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616
from __future__ import division
1717
from __future__ import print_function
1818

19+
import sys
20+
import unittest
21+
1922
import fire
2023
from fire import test_components as tc
2124
from fire import testutils
22-
from fire import trace
2325

2426
import mock
2527
import six
26-
import sys
27-
import unittest
2828

2929

3030
class FireTest(testutils.BaseTestCase):
31+
3132
def testFire(self):
3233
with mock.patch.object(sys, 'argv', ['progname']):
3334
fire.Fire(tc.Empty)

fire/inspectutils_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
from __future__ import print_function
1818

1919
import unittest
20-
import six
2120

2221
from fire import inspectutils
2322
from fire import test_components as tc
2423

24+
import six
25+
2526

2627
class InspectUtilsTest(unittest.TestCase):
2728

fire/testutils.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,28 @@
2121
import sys
2222
import unittest
2323

24-
import mock
25-
import six
26-
2724
from fire import core
2825
from fire import trace
2926

27+
import mock
28+
import six
29+
3030

3131
class BaseTestCase(unittest.TestCase):
32-
"""Shared test case for fire tests"""
32+
"""Shared test case for Python Fire tests."""
3333

3434
@contextlib.contextmanager
3535
def assertRaisesFireExit(self, code, regexp=None):
3636
"""Asserts that a FireExit error is raised in the context.
3737
3838
Allows tests to check that Fire's wrapper around SystemExit is raised
3939
and that a regexp is matched in the output.
40+
41+
Args:
42+
code: The status code that the FireExit should contain.
43+
regexp: stdout must match this regex.
44+
Yields:
45+
Yields to the wrapped context.
4046
"""
4147
if regexp is None:
4248
regexp = '.*'

0 commit comments

Comments
 (0)