Skip to content

Commit f1f964b

Browse files
committed
Fix 3 errors in python2.7
1 parent 4ebe171 commit f1f964b

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

pytest_pylint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ def pytest_configure(config):
166166
config.addinivalue_line('markers', "pylint: Tests which run pylint.")
167167

168168

169-
# pylint: disable=too-few-public-methods
170-
class PylintPlugin:
169+
# pylint: disable=too-few-public-methods, useless-object-inheritance
170+
class PylintPlugin(object):
171171
"""
172172
A Plugin object for pylint, which loads and records file mtimes.
173173
"""

test_pytest_pylint.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,20 +223,18 @@ def test_skip_checked_files(testdir):
223223
Test a file twice which can pass pylint.
224224
The 2nd time should be skipped.
225225
"""
226-
testdir.makepyfile('''#!/usr/bin/env python
227-
"""A hello world script."""
228-
229-
from __future__ import print_function
230-
231-
print('Hello world!')
232-
# pylint: disable=missing-final-newline
233-
''')
226+
testdir.makepyfile(
227+
'#!/usr/bin/env python',
228+
'"""A hello world script."""',
229+
'',
230+
'from __future__ import print_function',
231+
'',
232+
'print("Hello world!") # pylint: disable=missing-final-newline',
233+
)
234234
# The 1st time should be passed
235235
result = testdir.runpytest('--pylint')
236-
print(result.stdout.str())
237236
assert '1 passed' in result.stdout.str()
238237

239238
# The 2nd time should be skipped
240239
result = testdir.runpytest('--pylint')
241-
print(result.stdout.str())
242240
assert '1 skipped' in result.stdout.str()

0 commit comments

Comments
 (0)