Skip to content

Commit 51fc990

Browse files
authored
Adds pylint script to .travis.yml (google#38)
1 parent 4198d5a commit 51fc990

18 files changed

Lines changed: 81 additions & 59 deletions

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ python:
66
- "3.6"
77
before_install:
88
- pip install --upgrade setuptools pip
9+
- pip install --upgrade pylint pytest pytest-pylint pytest-runner
910
install:
1011
- python setup.py develop
11-
script: nosetests --ignore-files=parser_fuzz_test.py --exclude=test_components_py3.py
12+
script:
13+
- python -m pytest
14+
- if [[ $TRAVIS_PYTHON_VERSION != 3.6 ]]; then pylint fire --ignore=test_components_py3.py,parser_fuzz_test.py; fi

examples/__init__.py

Whitespace-only changes.

examples/cipher/__init__.py

Whitespace-only changes.

examples/cipher/cipher_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
"""Tests for the cipher module."""
16+
1517
from fire import testutils
1618

17-
from fire.examples.cipher import cipher
19+
from examples.cipher import cipher
1820

1921

2022
class CipherTest(testutils.BaseTestCase):

examples/diff/__init__.py

Whitespace-only changes.

examples/diff/diff_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
"""Tests for the diff and difffull modules."""
16+
1517
import tempfile
1618

1719
from fire import testutils
1820

19-
from fire.examples.diff import diff
20-
from fire.examples.diff import difffull
21+
from examples.diff import diff
22+
from examples.diff import difffull
2123

2224

2325
class DiffTest(testutils.BaseTestCase):
@@ -30,8 +32,8 @@ def setUp(self):
3032
self.file1 = file1 = tempfile.NamedTemporaryFile()
3133
self.file2 = file2 = tempfile.NamedTemporaryFile()
3234

33-
file1.write('test\ntest1\n')
34-
file2.write('test\ntest2\nextraline\n')
35+
file1.write(b'test\ntest1\n')
36+
file2.write(b'test\ntest2\nextraline\n')
3537

3638
file1.flush()
3739
file2.flush()

examples/identity/__init__.py

Whitespace-only changes.

examples/widget/__init__.py

Whitespace-only changes.

examples/widget/collector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import fire
1818

19-
from fire.examples.widget import widget
19+
from examples.widget import widget
2020

2121

2222
class Collector(object):
@@ -28,7 +28,7 @@ def __init__(self):
2828

2929
def collect_widgets(self):
3030
"""Returns all the widgets the Collector wants."""
31-
return [widget.Widget() for _ in xrange(self.desired_widget_count)]
31+
return [widget.Widget() for _ in range(self.desired_widget_count)]
3232

3333

3434
def main():

examples/widget/collector_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
"""Tests for the collector module."""
16+
1517
from fire import testutils
1618

17-
from fire.examples.widget import collector
18-
from fire.examples.widget import widget
19+
from examples.widget import collector
20+
from examples.widget import widget
1921

2022

2123
class CollectorTest(testutils.BaseTestCase):
@@ -26,11 +28,11 @@ def testCollectorHasWidget(self):
2628

2729
def testCollectorWantsMoreWidgets(self):
2830
col = collector.Collector()
29-
self.assertEquals(col.desired_widget_count, 10)
31+
self.assertEqual(col.desired_widget_count, 10)
3032

3133
def testCollectorGetsWantedWidgets(self):
3234
col = collector.Collector()
33-
self.assertEquals(len(col.collect_widgets()), 10)
35+
self.assertEqual(len(col.collect_widgets()), 10)
3436

3537

3638
if __name__ == '__main__':

0 commit comments

Comments
 (0)