mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
boilerplate_test:fix pylint warnings
Fixed the following Pylint warnings: boilerplate_test.py:34:8: R0205: Class 'Args' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) boilerplate_test.py:46:8: W0612: Unused variable 'ret' (unused-variable) boilerplate_test.py:18:0: C0411: standard import "import unittest" should be placed before "import boilerplate" (wrong-import-order) boilerplate_test.py:19:0: C0411: standard import "from io import StringIO" should be placed before "import boilerplate" (wrong-import-order) boilerplate_test.py:20:0: C0411: standard import "import os" should be placed before "import boilerplate" (wrong-import-order) boilerplate_test.py:21:0: C0411: standard import "import sys" should be placed before "import boilerplate" (wrong-import-order)
This commit is contained in:
parent
4473dfebbf
commit
83de1586e0
@ -14,12 +14,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import boilerplate
|
||||
import unittest
|
||||
from io import StringIO
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from io import StringIO
|
||||
|
||||
import boilerplate
|
||||
|
||||
class TestBoilerplate(unittest.TestCase):
|
||||
"""
|
||||
@ -31,19 +32,19 @@ class TestBoilerplate(unittest.TestCase):
|
||||
def test_boilerplate(self):
|
||||
os.chdir("test/")
|
||||
|
||||
class Args(object):
|
||||
def __init__(self):
|
||||
self.filenames = []
|
||||
self.rootdir = "."
|
||||
self.boilerplate_dir = "../"
|
||||
self.verbose = True
|
||||
class Args:
|
||||
filenames = []
|
||||
rootdir = "."
|
||||
boilerplate_dir = "../"
|
||||
verbose = True
|
||||
|
||||
# capture stdout
|
||||
old_stdout = sys.stdout
|
||||
sys.stdout = StringIO()
|
||||
|
||||
boilerplate.args = Args()
|
||||
boilerplate.args = Args
|
||||
ret = boilerplate.main()
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
output = sorted(sys.stdout.getvalue().split())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user