Skip to content

Commit

Permalink
Pylint fixes
Browse files Browse the repository at this point in the history
Recent pylint update is more pedantic about module level spacing. There
are no changes to code, only couple of extra spaces to make it happy.

Signed-off-by: Lukáš Doktor <[email protected]>
  • Loading branch information
ldoktor committed Nov 7, 2016
1 parent 9047e29 commit 88f6998
Show file tree
Hide file tree
Showing 46 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions avocado/core/data_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def __del__(self):
except AttributeError:
pass


_tmp_tracker = _TmpDirTracker()


Expand Down
1 change: 1 addition & 0 deletions avocado/utils/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def uncompress(filename, path):
with ArchiveFile.open(filename) as x:
x.extract(path)


# Some aliases
create = compress
extract = uncompress
1 change: 1 addition & 0 deletions avocado/utils/external/gdbmi_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def __repr__(self):

return (GdbMiScanner(), GdbMiParser(), GdbMiInterpreter, GdbMiRecord)


(__the_scanner, __the_parser, __the_interpreter, __the_output) = __private()


Expand Down
2 changes: 2 additions & 0 deletions avocado/utils/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ class has methods to start/stop services.
internal_parser(run))
return _service_manager


ServiceManager = service_manager


Expand Down Expand Up @@ -847,4 +848,5 @@ def specific_service_manager(service_name, run=process.run):
specific_generator(run),
_get_service_result_parser(run), run)


SpecificServiceManager = specific_service_manager
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ def symlink_coredumps():
except Exception:
pass


if __name__ == "__main__":
symlink_coredumps()
1 change: 1 addition & 0 deletions examples/tests/doublefree_nasty.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ def test(self):
cmd_result = process.run(cmd)
self.log.info(cmd_result)


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/tests/errortest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ def test(self):
"""
self.error('This should end with ERROR.')


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/tests/fail_on_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ def test(self):
"""
raise ValueError('This raises a ValueError and should end as a FAIL')


if __name__ == "__main__":
avocado.main()
1 change: 1 addition & 0 deletions examples/tests/multiple_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ def action(self):
"""
raise Exception('This action method should never be executed.')


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions examples/tests/skip_outside_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ def test(self):
"""
self.skip('Calling skip() outside setUp() will result in ERROR')


if __name__ == "__main__":
avocado.main()
1 change: 1 addition & 0 deletions examples/tests/skiponsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ def test_wont_be_executed(self):
"""
pass


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/tests/sleeptenmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ def test(self):
elif method == 'shell':
os.system("sleep %s" % length)


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/tests/uncaught_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ def test(self):
"""
raise Exception("This is a generic exception")


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/tests/warntest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ def test(self):
"""
self.log.warn("This marks test as WARN")


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/tests/whiteboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ def test(self):
result += data
self.whiteboard = base64.encodestring(result)


if __name__ == "__main__":
main()
3 changes: 3 additions & 0 deletions scripts/avocado
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def handle_exception(*exc_info):
# imported because we are dealing with import failures
sys.exit(-1)


if __name__ == '__main__':
sys.excepthook = handle_exception

Expand All @@ -66,8 +67,10 @@ if os.path.isdir(os.path.join(basedir, 'avocado')):
os.environ['PATH'] += ":" + os.path.join(basedir, 'libexec')
sys.path.append(basedir)


from avocado.core.app import AvocadoApp


if __name__ == '__main__':
# Override tmp in case it's not set in env
for attr in ("TMP", "TEMP", "TMPDIR"):
Expand Down
2 changes: 2 additions & 0 deletions scripts/avocado-run-testplan
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Parser(argparse.ArgumentParser):
'will show a human readable report for the '
'given result file'))


RESULT_MAP = {"P": "PASS",
"p": "PASS",
"F": "FAIL",
Expand Down Expand Up @@ -167,6 +168,7 @@ class App(object):
print("%s: %s" % (name, out))
return 0


if __name__ == '__main__':
app = App()
sys.exit(app.run())
1 change: 1 addition & 0 deletions selftests/functional/test_argument_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ def test_whacky_option(self):
self.run_but_fail_before_create_job_dir('--whacky-option passtest',
exit_codes.AVOCADO_FAIL)


if __name__ == '__main__':
unittest.main()
2 changes: 2 additions & 0 deletions selftests/functional/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def probe_binary(binary):
except utils_path.CmdNotFoundError:
return None


CC_BINARY = probe_binary('cc')
ECHO_BINARY = probe_binary('echo')
READ_BINARY = probe_binary('read')
Expand Down Expand Up @@ -1152,5 +1153,6 @@ def tearDown(self):
shutil.rmtree(self.tmpdir)
super(PluginsJSONTest, self).tearDown()


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_export_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ def tearDown(self):
self.script.remove()
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ def test_gdb_multiple_prerun_commands(self):
def tearDown(self):
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_interrupt.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,6 @@ def wait_until_no_goodtest():
def tearDown(self):
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_job_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@ def tearDown(self):
self.py.remove()
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_multiplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,6 @@ def test_run_mplex_params(self):
def tearDown(self):
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_output_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ def tearDown(self):
self.output_script.remove()
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ def test_errortest(self):
expected_rc = exit_codes.AVOCADO_TESTS_FAIL
self.run_and_check(cmd_line, expected_rc, 'errortest')


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ def test_sysinfo_disabled(self):
def tearDown(self):
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_thirdparty_bugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ def test_paramiko_ecsda_bug(self):
except download.urllib2.URLError as details:
raise unittest.SkipTest(details)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/functional/test_unittest_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ def test_run_error(self):
self.assertIn('This test is supposed to error', result.stderr)
self.assertIn('FAILED (errors=1)', result.stderr)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/run
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_suite():
top_level_dir=basedir))
return suite


if __name__ == '__main__':
runner = unittest.TextTestRunner(failfast=not os.environ.get("SELF_CHECK_CONTINUOUS"))
result = runner.run(test_suite())
Expand Down
1 change: 1 addition & 0 deletions selftests/unit/test_astring.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ def testUnicodeTabular(self):
"avocado 123")
self.assertEqual(astring.tabular_output(matrix), str_matrix)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_datadir.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ def tearDown(self):
if hasattr(self, 'alt_mapping'):
shutil.rmtree(self.alt_mapping['base_dir'])


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ def test_order(self):
self.assertEqual(names, sorted(names))
self.assertEqual(ext_names, sorted(ext_names))


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ def post_tests(self):
self.assertEqual(myjob.unique_id[::-1],
open(os.path.join(myjob.logdir, "reversed_id")).read())


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,6 @@ def test_setup(self):
self.runner.setup()
flexmock_teardown()


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_restclient_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ def test_bad_data_results(self):
response.ResultResponse,
self.BAD_DATA_RESULTS)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,6 @@ def testAllowBlankFalse(self):
def tearDown(self):
os.unlink(self.config_file.name)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@ def test_logger_test_hooks(self):
def tearDown(self):
shutil.rmtree(self.tmpdir)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,6 @@ def tearDown(self):
except Exception:
pass


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,6 @@ def test_direct_parent(self):
def test_false_direct_parent(self):
self.assertNotEqual(tree.path_parent('/os/linux'), '/')


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_utils_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@ def testFetch_lockerror(self):
def tearDown(self):
shutil.rmtree(self.basedir)


if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_utils_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ def test_locked_by_other(self):
def tearDown(self):
shutil.rmtree(self.basedir)


if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_utils_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,6 @@ def test_binary_from_shell(self):
res = process.binary_from_shell_cmd("FOO=bar ./bin var=value")
self.assertEqual("./bin", res)


if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_utils_stacktrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ def check(exps, obj):
ListWithUnpickableAttribute(ListWithUnpickableAttribute(
[InClassUnpickable()]))])


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions selftests/unit/test_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ def test_setup(self):
self.runner.tear_down()
flexmock_teardown()


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def get_long_description():
req_contents = req.read()
return req_contents


if __name__ == '__main__':
setup(name='avocado-framework',
version=VERSION,
Expand Down

0 comments on commit 88f6998

Please sign in to comment.